From 0256804b4c11ba066d60e8afbf4b8de20ea3f0f7 Mon Sep 17 00:00:00 2001 From: API Team Date: Wed, 18 Sep 2024 16:43:03 +0000 Subject: [PATCH] [GitHub Bot] Generated python SDK --- .../.openapi-generator/FILES | 8 +- thousandeyes-sdk-administrative/README.md | 9 +- .../docs/AccountGroupDetail.md | 1 + .../docs/AccountGroupsApi.md | 18 +- .../docs/AgentResponse.md | 39 + .../docs/ExpandAccountGroupOptions.md | 11 + .../docs/UsersApi.md | 81 + .../administrative/__init__.py | 4 +- .../administrative/api/account_groups_api.py | 38 +- .../administrative/api/users_api.py | 265 ++ .../administrative/models/__init__.py | 4 +- .../models/account_group_detail.py | 6 +- .../administrative/models/agent_response.py | 124 + .../models/expand_account_group_options.py | 36 + .../test/test_account_groups_api.py | 2 + .../test/test_users_api.py | 76 + .../.openapi-generator/FILES | 18 +- thousandeyes-sdk-agents/README.md | 21 +- thousandeyes-sdk-agents/docs/AgentDetails.md | 2 +- thousandeyes-sdk-agents/docs/AgentLabel.md | 30 + .../docs/AgentNotification.md | 32 + .../docs/AgentProxiesApi.md | 94 + thousandeyes-sdk-agents/docs/AgentResponse.md | 39 + .../docs/CloudAgentDetail.md | 2 +- .../docs/EnterpriseAgentClusterDetail.md | 2 +- .../docs/EnterpriseAgentDetail.md | 2 +- .../docs/EnterpriseAgentResponseExpands.md | 2 +- .../docs/NotificationRuleDetail.md | 4 +- .../src/thousandeyes_sdk/agents/__init__.py | 8 +- .../thousandeyes_sdk/agents/api/__init__.py | 2 +- .../agents/api/agent_proxies_api.py | 324 ++ .../agents/models/__init__.py | 6 +- .../agents/models/agent_label.py | 89 + .../agents/models/agent_notification.py | 110 + .../agents/models/agent_response.py | 124 + .../agents/models/cloud_agent_detail.py | 6 +- .../agents/models/cloud_enterprise_agent.py | 28 +- .../models/enterprise_agent_cluster_detail.py | 6 +- .../agents/models/enterprise_agent_detail.py | 6 +- .../enterprise_agent_response_expands.py | 6 +- .../agents/models/notification_rule_detail.py | 12 +- .../test/test_agent_proxies_api.py | 81 + .../test_cloud_and_enterprise_agents_api.py | 8 +- .../test/test_enterprise_agent_cluster_api.py | 4 +- .../.openapi-generator/FILES | 8 +- thousandeyes-sdk-alerts/README.md | 6 +- thousandeyes-sdk-alerts/docs/Alert.md | 4 +- thousandeyes-sdk-alerts/docs/AlertDetail.md | 4 +- .../docs/AlertNotification.md | 33 + .../docs/AlertSuppressionWindowsApi.md | 18 +- thousandeyes-sdk-alerts/docs/BaseAlert.md | 4 +- .../docs/ExpandAlertTestOptions.md | 11 + thousandeyes-sdk-alerts/docs/Rule.md | 2 +- thousandeyes-sdk-alerts/docs/RuleDetail.md | 2 +- .../docs/RuleDetailUpdate.md | 2 +- .../src/thousandeyes_sdk/alerts/__init__.py | 4 +- .../api/alert_suppression_windows_api.py | 38 +- .../alerts/models/__init__.py | 4 +- .../thousandeyes_sdk/alerts/models/alert.py | 4 +- .../alerts/models/alert_detail.py | 4 +- .../alerts/models/alert_notification.py | 121 + .../alerts/models/base_alert.py | 4 +- .../models/expand_alert_test_options.py | 35 + .../thousandeyes_sdk/alerts/models/rule.py | 6 +- .../alerts/models/rule_detail.py | 6 +- .../alerts/models/rule_detail_update.py | 6 +- .../test/test_alert_rules_api.py | 4 +- .../test_alert_suppression_windows_api.py | 12 +- .../test/test_alerts_api.py | 12 +- .../.openapi-generator/FILES | 6 +- thousandeyes-sdk-bgp-monitors/README.md | 10 +- .../docs/BGPMonitorsApi.md | 92 + .../thousandeyes_sdk/bgp_monitors/__init__.py | 2 +- .../bgp_monitors/api/__init__.py | 2 +- .../bgp_monitors/api/bgp_monitors_api.py | 321 ++ .../test/test_bgp_monitors_api.py | 71 + thousandeyes-sdk-credentials/README.md | 2 +- .../.openapi-generator/FILES | 2 - thousandeyes-sdk-dashboards/README.md | 3 +- .../docs/ActiveWithin.md | 1 + .../docs/DashboardSnapshotsApi.md | 4 +- .../thousandeyes_sdk/dashboards/__init__.py | 1 - .../dashboards/api/dashboard_snapshots_api.py | 6 +- .../dashboards/models/__init__.py | 1 - .../dashboards/models/active_within.py | 2 +- .../.openapi-generator/FILES | 4 +- thousandeyes-sdk-emulation/README.md | 4 +- .../docs/EmulationApi.md | 6 +- .../docs/ExpandEmulatedDeviceOptions.md | 11 + .../thousandeyes_sdk/emulation/__init__.py | 2 +- .../emulation/api/emulation_api.py | 14 +- .../emulation/models/__init__.py | 2 +- .../models/expand_emulated_device_options.py | 35 + .../.openapi-generator/FILES | 23 +- thousandeyes-sdk-endpoint-agents/README.md | 38 +- .../docs/AgentTransfer.md | 2 +- .../docs/EndpointAgent.md | 2 +- .../docs/EndpointAgentEthernetProfile.md | 30 + .../docs/EndpointAgentsApi.md | 716 +++++ .../docs/EndpointAgentsTransferApi.md | 180 ++ .../docs/ExpandEndpointAgentOptions.md | 11 + .../docs/InterfaceProfile.md | 2 +- .../docs/Platform.md | 2 +- .../endpoint_agents/__init__.py | 9 +- .../endpoint_agents/api/__init__.py | 5 +- .../api/endpoint_agents_api.py | 2637 +++++++++++++++++ .../api/endpoint_agents_transfer_api.py | 671 +++++ .../endpoint_agents/models/__init__.py | 4 +- .../endpoint_agents/models/agent_transfer.py | 2 +- .../endpoint_agents/models/endpoint_agent.py | 2 +- .../models/endpoint_agent_ethernet_profile.py | 87 + .../models/expand_endpoint_agent_options.py | 37 + .../models/interface_profile.py | 6 +- .../endpoint_agents/models/platform.py | 5 +- .../test/test_endpoint_agents_api.py | 1392 +++++++++ .../test/test_endpoint_agents_transfer_api.py | 97 + .../.openapi-generator/FILES | 32 +- .../README.md | 21 +- ...oServerEndpointInstantScheduledTestsApi.md | 97 + .../docs/EndpointAgentLabelsSelectorConfig.md | 2 +- .../docs/EndpointAgentSelectorConfig.md | 2 +- .../docs/EndpointAgentToServerInstantTest.md | 8 +- .../docs/EndpointAgentToServerTest.md | 3 +- .../docs/EndpointAllAgentsSelectorConfig.md | 2 +- .../docs/EndpointHttpServerBaseTest.md | 6 +- .../docs/EndpointHttpServerInstantTest.md | 21 +- .../docs/EndpointHttpServerTest.md | 12 +- .../docs/EndpointInstantTest.md | 7 +- .../EndpointRunScheduledInstantTestResult.md | 29 + .../EndpointSpecificAgentsSelectorConfig.md | 2 +- .../docs/EndpointTest.md | 3 +- ...PServerEndpointInstantScheduledTestsApi.md | 97 + .../RunEndpointInstantScheduledTestsApi.md | 94 + .../endpoint_instant_tests/__init__.py | 13 +- .../endpoint_instant_tests/api/__init__.py | 6 +- ...er_endpoint_instant_scheduled_tests_api.py | 353 +++ ...er_endpoint_instant_scheduled_tests_api.py | 353 +++ ...un_endpoint_instant_scheduled_tests_api.py | 340 +++ .../endpoint_instant_tests/models/__init__.py | 7 +- .../endpoint_agent_labels_selector_config.py | 4 +- .../endpoint_agent_to_server_instant_test.py | 20 +- .../models/endpoint_agent_to_server_test.py | 16 +- .../endpoint_all_agents_selector_config.py | 4 +- .../models/endpoint_http_server_base_test.py | 14 +- .../endpoint_http_server_instant_test.py | 42 +- .../models/endpoint_http_server_test.py | 34 +- .../models/endpoint_instant_test.py | 16 +- ...point_run_scheduled_instant_test_result.py | 87 + ...ndpoint_specific_agents_selector_config.py | 4 +- .../models/endpoint_test.py | 16 +- ...er_endpoint_instant_scheduled_tests_api.py | 103 + ...er_endpoint_instant_scheduled_tests_api.py | 127 + ...un_endpoint_instant_scheduled_tests_api.py | 37 + .../.openapi-generator/FILES | 10 +- thousandeyes-sdk-endpoint-labels/README.md | 20 +- .../docs/EndpointAgentLabelsApi.md | 442 +++ .../docs/ExpandLabelOptions.md | 11 + .../endpoint_labels/__init__.py | 4 +- .../endpoint_labels/api/__init__.py | 2 +- .../api/endpoint_agent_labels_api.py | 1596 ++++++++++ .../endpoint_labels/models/__init__.py | 2 +- .../models/expand_label_options.py | 35 + .../test/test_endpoint_agent_labels_api.py | 271 ++ .../.openapi-generator/FILES | 274 +- .../README.md | 171 +- .../docs/DynamicBaseEndpointTestResult.md | 33 + .../docs/DynamicEndpointTestWebex.md | 33 + .../DynamicEndpointTestsDataRoundSearch.md | 31 + .../DynamicEndpointTestsDataSearchFilter.md | 30 + .../docs/EndpointAgentLabelsSelectorConfig.md | 2 +- .../docs/EndpointAgentSelectorConfig.md | 2 +- .../docs/EndpointAgentToServerTest.md | 3 +- .../docs/EndpointAllAgentsSelectorConfig.md | 2 +- .../docs/EndpointHttpServerBaseTest.md | 6 +- .../docs/EndpointHttpServerTest.md | 12 +- .../docs/EndpointPathTrace.md | 35 + .../docs/EndpointPathVisHop.md | 35 + .../docs/EndpointPathVisRoute.md | 33 + .../docs/EndpointScheduledTest.md | 12 +- .../EndpointSpecificAgentsSelectorConfig.md | 2 +- .../docs/EndpointTest.md | 3 +- .../docs/EndpointTestEthernetProfile.md | 29 + .../docs/EndpointTestResult.md | 37 + .../docs/EndpointTestsDataRoundsSearch.md | 31 + .../docs/EndpointTestsDataSearchFilter.md | 29 + .../docs/EndpointTestsDataSearchSort.md | 30 + .../docs/EndpointTestsDataSearchSortKey.md | 11 + .../docs/EndpointTestsDataThresholdFilter.md | 32 + .../docs/EndpointTestsDataThresholdFilters.md | 31 + .../docs/ExpandEndpointHttpServerOptions.md | 11 + ...TPServerEndpointScheduledTestResultsApi.md | 206 ++ .../docs/HttpEndpointTestResult.md | 51 + .../docs/HttpEndpointTestResultHeaders.md | 31 + .../docs/HttpEndpointTestResults.md | 33 + .../docs/HttpEndpointTestsDataRoundsSearch.md | 31 + .../docs/HttpEndpointTestsDataSearchFilter.md | 30 + .../docs/HttpEndpointTestsDataSearchSort.md | 30 + .../HttpEndpointTestsDataSearchSortKey.md | 11 + .../HttpEndpointTestsDataThresholdFilter.md | 32 + .../HttpEndpointTestsDataThresholdFilters.md | 31 + .../docs/HttpMultiEndpointTestResults.md | 33 + .../LocalNetworkEndpointTestResultsApi.md | 277 ++ .../docs/LocalNetworkTopologyResult.md | 2 +- ...ultiTestIdEndpointTestsDataRoundsSearch.md | 31 + ...ultiTestIdEndpointTestsDataSearchFilter.md | 30 + .../MultiTestIdNetworkEndpointTestResults.md | 33 + .../docs/NetworkDynamicEndpointTestResult.md | 49 + .../docs/NetworkDynamicEndpointTestResults.md | 34 + .../NetworkDynamicEndpointTestResultsApi.md | 293 ++ .../NetworkEndpointScheduledTestResultsApi.md | 390 +++ .../docs/NetworkEndpointTestResult.md | 44 + .../docs/NetworkEndpointTestResults.md | 34 + .../docs/NetworkProfile.md | 2 +- .../docs/PathVisBaseEndpointTestResult.md | 41 + .../PathVisDetailDynamicEndpointTestResult.md | 48 + ...PathVisDetailDynamicEndpointTestResults.md | 31 + .../docs/PathVisDetailEndpointTestResult.md | 43 + .../docs/PathVisDetailEndpointTestResults.md | 31 + .../docs/PathVisDynamicEndpointTestResult.md | 48 + .../docs/PathVisDynamicEndpointTestResults.md | 34 + .../docs/PathVisEndpointTestResult.md | 43 + .../docs/PathVisEndpointTestResults.md | 33 + .../docs/Platform.md | 2 +- .../docs/RealUserEndpointTest.md | 41 + .../docs/RealUserEndpointTestBase.md | 40 + .../docs/RealUserEndpointTestCoordinates.md | 32 + .../docs/RealUserEndpointTestDetail.md | 44 + .../docs/RealUserEndpointTestDetailResults.md | 30 + .../docs/RealUserEndpointTestNetwork.md | 39 + .../docs/RealUserEndpointTestNetworkResult.md | 36 + .../RealUserEndpointTestNetworkResults.md | 32 + .../docs/RealUserEndpointTestPage.md | 34 + .../RealUserEndpointTestPageDetailResult.md | 30 + .../docs/RealUserEndpointTestPageResult.md | 39 + .../docs/RealUserEndpointTestPageResults.md | 32 + .../docs/RealUserEndpointTestPageTimings.md | 30 + ...RealUserEndpointTestResultRequestFilter.md | 42 + .../docs/RealUserEndpointTestResults.md | 32 + .../docs/RealUserEndpointTestResultsApi.md | 475 +++ .../RealUserEndpointTestResultsRequest.md | 29 + .../endpoint_test_results/__init__.py | 132 +- .../endpoint_test_results/api/__init__.py | 10 +- ...ver_endpoint_scheduled_test_results_api.py | 864 ++++++ ...local_network_endpoint_test_results_api.py | 1024 +++++++ ...twork_dynamic_endpoint_test_results_api.py | 1170 ++++++++ ...ork_endpoint_scheduled_test_results_api.py | 1582 ++++++++++ .../real_user_endpoint_test_results_api.py | 1855 ++++++++++++ .../endpoint_test_results/models/__init__.py | 122 +- .../dynamic_base_endpoint_test_result.py | 102 + .../models/dynamic_endpoint_test_webex.py | 101 + ...ynamic_endpoint_tests_data_round_search.py | 107 + ...namic_endpoint_tests_data_search_filter.py | 89 + .../endpoint_agent_labels_selector_config.py | 4 +- .../models/endpoint_agent_to_server_test.py | 16 +- .../endpoint_all_agents_selector_config.py | 4 +- .../models/endpoint_http_server_base_test.py | 14 +- .../models/endpoint_http_server_test.py | 34 +- .../models/endpoint_path_trace.py | 110 + .../models/endpoint_path_vis_hop.py | 113 + .../models/endpoint_path_vis_route.py | 108 + ...ndpoint_specific_agents_selector_config.py | 4 +- .../models/endpoint_test.py | 16 +- .../models/endpoint_test_ethernet_profile.py | 89 + .../models/endpoint_test_result.py | 127 + .../endpoint_tests_data_rounds_search.py | 107 + .../endpoint_tests_data_search_filter.py | 87 + .../models/endpoint_tests_data_search_sort.py | 91 + .../endpoint_tests_data_search_sort_key.py | 41 + .../endpoint_tests_data_threshold_filter.py | 93 + .../endpoint_tests_data_threshold_filters.py | 98 + .../expand_endpoint_http_server_options.py | 35 + .../models/http_endpoint_test_result.py | 184 ++ .../http_endpoint_test_result_headers.py | 93 + .../models/http_endpoint_test_results.py | 116 + .../http_endpoint_tests_data_rounds_search.py | 107 + .../http_endpoint_tests_data_search_filter.py | 89 + .../http_endpoint_tests_data_search_sort.py | 91 + ...ttp_endpoint_tests_data_search_sort_key.py | 42 + ...tp_endpoint_tests_data_threshold_filter.py | 93 + ...p_endpoint_tests_data_threshold_filters.py | 98 + .../http_multi_endpoint_test_results.py | 112 + .../models/local_network_topology_result.py | 6 +- ...st_id_endpoint_tests_data_rounds_search.py | 107 + ...st_id_endpoint_tests_data_search_filter.py | 89 + ...i_test_id_network_endpoint_test_results.py | 112 + .../network_dynamic_endpoint_test_result.py | 172 ++ .../network_dynamic_endpoint_test_results.py | 118 + .../models/network_endpoint_test_result.py | 155 + .../models/network_endpoint_test_results.py | 118 + .../models/network_profile.py | 6 +- .../path_vis_base_endpoint_test_result.py | 145 + ...vis_detail_dynamic_endpoint_test_result.py | 181 ++ ...is_detail_dynamic_endpoint_test_results.py | 107 + .../path_vis_detail_endpoint_test_result.py | 164 + .../path_vis_detail_endpoint_test_results.py | 107 + .../path_vis_dynamic_endpoint_test_result.py | 176 ++ .../path_vis_dynamic_endpoint_test_results.py | 118 + .../models/path_vis_endpoint_test_result.py | 159 + .../models/path_vis_endpoint_test_results.py | 116 + .../endpoint_test_results/models/platform.py | 5 +- .../models/real_user_endpoint_test.py | 139 + .../models/real_user_endpoint_test_base.py | 135 + .../real_user_endpoint_test_coordinates.py | 97 + .../models/real_user_endpoint_test_detail.py | 163 + .../real_user_endpoint_test_detail_results.py | 101 + .../models/real_user_endpoint_test_network.py | 139 + .../real_user_endpoint_test_network_result.py | 124 + ...real_user_endpoint_test_network_results.py | 110 + .../models/real_user_endpoint_test_page.py | 112 + ...l_user_endpoint_test_page_detail_result.py | 93 + .../real_user_endpoint_test_page_result.py | 134 + .../real_user_endpoint_test_page_results.py | 110 + .../real_user_endpoint_test_page_timings.py | 93 + ...ser_endpoint_test_result_request_filter.py | 116 + .../models/real_user_endpoint_test_results.py | 110 + ...real_user_endpoint_test_results_request.py | 91 + ...ver_endpoint_scheduled_test_results_api.py | 598 ++++ ...local_network_endpoint_test_results_api.py | 559 ++++ ...twork_dynamic_endpoint_test_results_api.py | 1111 +++++++ ...ork_endpoint_scheduled_test_results_api.py | 1291 ++++++++ ...est_real_user_endpoint_test_results_api.py | 1016 +++++++ .../.openapi-generator/FILES | 36 +- thousandeyes-sdk-endpoint-tests/README.md | 46 +- .../AgentToServerEndpointDynamicTestsApi.md | 449 +++ .../AgentToServerEndpointScheduledTestsApi.md | 449 +++ .../docs/DynamicTestRequest.md | 25 +- .../docs/EndpointAgentLabelsSelectorConfig.md | 2 +- .../docs/EndpointAgentSelectorConfig.md | 2 +- .../docs/EndpointAgentToServerInstantTest.md | 8 +- .../docs/EndpointAgentToServerTest.md | 3 +- .../docs/EndpointAgentToServerTestRequest.md | 10 +- .../docs/EndpointAllAgentsSelectorConfig.md | 2 +- .../docs/EndpointHttpServerBaseTest.md | 6 +- .../docs/EndpointHttpServerInstantTest.md | 21 +- .../docs/EndpointHttpServerTest.md | 12 +- .../docs/EndpointHttpServerTestRequest.md | 23 +- .../docs/EndpointInstantTest.md | 7 +- .../docs/EndpointScheduledTestsApi.md | 93 + .../EndpointSpecificAgentsSelectorConfig.md | 2 +- .../docs/EndpointTest.md | 3 +- .../HTTPServerEndpointScheduledTestsApi.md | 449 +++ .../endpoint_tests/__init__.py | 14 +- .../endpoint_tests/api/__init__.py | 8 +- ...nt_to_server_endpoint_dynamic_tests_api.py | 1561 ++++++++++ ..._to_server_endpoint_scheduled_tests_api.py | 1561 ++++++++++ .../api/endpoint_scheduled_tests_api.py | 321 ++ ...ttp_server_endpoint_scheduled_tests_api.py | 1561 ++++++++++ .../endpoint_tests/models/__init__.py | 6 - .../models/dynamic_test_request.py | 77 +- .../endpoint_agent_labels_selector_config.py | 4 +- .../endpoint_agent_to_server_instant_test.py | 20 +- .../models/endpoint_agent_to_server_test.py | 16 +- .../endpoint_agent_to_server_test_request.py | 20 +- .../endpoint_all_agents_selector_config.py | 4 +- .../models/endpoint_http_server_base_test.py | 14 +- .../endpoint_http_server_instant_test.py | 42 +- .../models/endpoint_http_server_test.py | 34 +- .../endpoint_http_server_test_request.py | 42 +- .../models/endpoint_instant_test.py | 16 +- ...ndpoint_specific_agents_selector_config.py | 4 +- .../endpoint_tests/models/endpoint_test.py | 16 +- ...nt_to_server_endpoint_dynamic_tests_api.py | 346 +++ ..._to_server_endpoint_scheduled_tests_api.py | 351 +++ .../test/test_endpoint_scheduled_tests_api.py | 131 + ...ttp_server_endpoint_scheduled_tests_api.py | 417 +++ .../.openapi-generator/FILES | 16 +- thousandeyes-sdk-event-detection/README.md | 10 +- .../docs/AffectedAgents.md | 2 +- .../docs/AffectedTests.md | 2 +- .../docs/AgentLocalEventDetail.md | 2 +- .../docs/DnsEventDetail.md | 2 +- .../docs/Event.md | 2 +- .../docs/EventAlertSeverity.md | 12 + .../docs/EventApiAffectedAgent.md | 36 + .../docs/EventApiAffectedTest.md | 34 + .../docs/EventDetail.md | 2 +- .../docs/EventDetailBase.md | 2 +- .../docs/EventTestLinks.md | 30 + .../docs/NetworkEventDetail.md | 2 +- .../docs/NetworkPopEventDetail.md | 2 +- .../docs/ProxyEventDetail.md | 2 +- .../docs/SimpleEventDetail.md | 2 +- .../docs/TargetEventDetail.md | 2 +- .../docs/TargetNetworkEventDetail.md | 2 +- .../event_detection/__init__.py | 8 +- .../event_detection/models/__init__.py | 8 +- .../event_detection/models/affected_agents.py | 6 +- .../event_detection/models/affected_tests.py | 6 +- .../models/agent_local_event_detail.py | 4 +- .../models/dns_event_detail.py | 4 +- .../event_detection/models/event.py | 4 +- .../models/event_alert_severity.py | 37 + .../models/event_api_affected_agent.py | 114 + .../models/event_api_affected_test.py | 106 + .../models/event_detail_base.py | 4 +- .../models/event_test_links.py | 91 + .../models/network_event_detail.py | 4 +- .../models/network_pop_event_detail.py | 4 +- .../models/proxy_event_detail.py | 4 +- .../models/simple_event_detail.py | 4 +- .../models/target_event_detail.py | 4 +- .../models/target_network_event_detail.py | 4 +- .../.openapi-generator/FILES | 114 +- thousandeyes-sdk-instant-tests/README.md | 54 +- .../docs/APIInstantTestsApi.md | 101 + .../docs/AgentResponse.md | 39 + .../docs/AgentToAgentInstantTest.md | 1 - .../docs/AgentToAgentInstantTestResponse.md | 55 + .../docs/AgentToAgentInstantTestsApi.md | 101 + .../docs/AgentToServerInstantTest.md | 1 - .../docs/AgentToServerInstantTestResponse.md | 57 + .../docs/AgentToServerInstantTestsApi.md | 101 + .../docs/ApiInstantTest.md | 4 +- .../docs/ApiInstantTestRequest.md | 5 +- .../docs/ApiInstantTestResponse.md | 59 + .../docs/ApiProperties.md | 3 + .../docs/DNSSECInstantTestsApi.md | 101 + .../docs/DNSServerInstantTestsApi.md | 101 + .../docs/DNSTraceInstantTestsApi.md | 101 + .../docs/DnsSecInstantTest.md | 1 - .../docs/DnsSecInstantTestResponse.md | 44 + .../docs/DnsServerInstantTest.md | 1 - .../docs/DnsServerInstantTestResponse.md | 56 + .../docs/DnsTraceInstantTest.md | 1 - .../docs/DnsTraceInstantTestResponse.md | 45 + .../docs/ExpandInstantTestOptions.md | 11 + .../docs/FTPServerInstantTestsApi.md | 101 + .../docs/FtpServerInstantTest.md | 1 - .../docs/FtpServerInstantTestRequest.md | 60 + .../docs/FtpServerInstantTestResponse.md | 60 + .../docs/HTTPPageLoadInstantTestsApi.md | 101 + .../docs/HTTPServerInstantTestsApi.md | 101 + .../docs/HttpServerBaseProperties.md | 2 +- .../docs/HttpServerInstantTest.md | 3 +- .../docs/HttpServerInstantTestRequest.md | 2 +- .../docs/HttpServerInstantTestResponse.md | 79 + .../docs/HttpServerProperties.md | 2 +- .../docs/InstantTestsApi.md | 93 + .../docs/PageLoadInstantTest.md | 3 +- .../docs/PageLoadInstantTestRequest.md | 2 +- .../docs/PageLoadInstantTestResponse.md | 85 + .../docs/PageLoadProperties.md | 2 +- .../docs/SIPServerInstantTestsApi.md | 101 + .../docs/SipServerInstantTest.md | 1 - .../docs/SipServerInstantTestResponse.md | 2 +- .../docs/VoiceInstantTest.md | 1 - .../docs/VoiceInstantTestResponse.md | 51 + .../docs/VoiceInstantTestsApi.md | 101 + .../docs/WebTransactionInstantTest.md | 3 +- .../docs/WebTransactionInstantTestRequest.md | 4 +- .../docs/WebTransactionInstantTestResponse.md | 87 + .../docs/WebTransactionInstantTestsApi.md | 101 + .../docs/WebTransactionProperties.md | 2 +- .../instant_tests/__init__.py | 44 +- .../instant_tests/api/__init__.py | 26 +- .../api/agent_to_agent_instant_tests_api.py | 375 +++ .../api/agent_to_server_instant_tests_api.py | 375 +++ .../api/api_instant_tests_api.py | 375 +++ .../api/dns_server_instant_tests_api.py | 375 +++ .../api/dns_trace_instant_tests_api.py | 375 +++ .../api/dnssec_instant_tests_api.py | 375 +++ .../api/ftp_server_instant_tests_api.py | 375 +++ .../api/http_page_load_instant_tests_api.py | 375 +++ .../api/http_server_instant_tests_api.py | 375 +++ .../instant_tests/api/instant_tests_api.py | 337 +++ .../api/sip_server_instant_tests_api.py | 375 +++ .../api/voice_instant_tests_api.py | 375 +++ .../api/web_transaction_instant_tests_api.py | 375 +++ .../instant_tests/models/__init__.py | 18 +- .../instant_tests/models/agent_response.py | 124 + .../models/agent_to_agent_instant_test.py | 16 +- .../agent_to_agent_instant_test_response.py | 195 ++ .../models/agent_to_server_instant_test.py | 16 +- .../agent_to_server_instant_test_response.py | 200 ++ .../instant_tests/models/api_instant_test.py | 20 +- .../models/api_instant_test_request.py | 14 +- .../models/api_instant_test_response.py | 217 ++ .../instant_tests/models/api_properties.py | 8 +- .../models/dns_sec_instant_test.py | 16 +- .../models/dns_sec_instant_test_response.py | 167 ++ .../models/dns_server_instant_test.py | 16 +- .../dns_server_instant_test_response.py | 205 ++ .../models/dns_trace_instant_test.py | 16 +- .../models/dns_trace_instant_test_response.py | 170 ++ .../models/expand_instant_test_options.py | 37 + .../models/ftp_server_instant_test.py | 16 +- .../models/ftp_server_instant_test_request.py | 184 ++ .../ftp_server_instant_test_response.py | 204 ++ .../models/http_server_base_properties.py | 4 +- .../models/http_server_instant_test.py | 20 +- .../http_server_instant_test_request.py | 4 +- .../http_server_instant_test_response.py | 257 ++ .../models/http_server_properties.py | 4 +- .../models/page_load_instant_test.py | 20 +- .../models/page_load_instant_test_request.py | 4 +- .../models/page_load_instant_test_response.py | 269 ++ .../models/page_load_properties.py | 4 +- .../models/sip_server_instant_test.py | 16 +- .../sip_server_instant_test_response.py | 12 +- .../models/voice_instant_test.py | 16 +- .../models/voice_instant_test_response.py | 186 ++ .../models/web_transaction_instant_test.py | 18 +- .../web_transaction_instant_test_request.py | 12 +- .../web_transaction_instant_test_response.py | 273 ++ .../models/web_transaction_properties.py | 4 +- .../test_agent_to_agent_instant_tests_api.py | 181 ++ .../test_agent_to_server_instant_tests_api.py | 185 ++ .../test/test_api_instant_tests_api.py | 337 +++ .../test/test_dns_server_instant_tests_api.py | 189 ++ .../test/test_dns_trace_instant_tests_api.py | 161 + .../test/test_dnssec_instant_tests_api.py | 159 + .../test/test_ftp_server_instant_tests_api.py | 191 ++ .../test_http_page_load_instant_tests_api.py | 289 ++ .../test_http_server_instant_tests_api.py | 277 ++ .../test/test_instant_tests_api.py | 37 + .../test/test_sip_server_instant_tests_api.py | 191 ++ .../test/test_voice_instant_tests_api.py | 173 ++ .../test_web_transaction_instant_tests_api.py | 293 ++ .../.openapi-generator/FILES | 20 +- thousandeyes-sdk-internet-insights/README.md | 22 +- .../docs/ApiApplicationOutageDetails.md | 4 +- .../docs/ApiNetworkOutageDetails.md | 4 +- .../docs/InternetInsightsApiAffectedAgent.md | 30 + .../docs/InternetInsightsApiAffectedTest.md | 30 + .../InternetInsightsCatalogProvidersApi.md | 187 ++ .../docs/InternetInsightsOutagesApi.md | 276 ++ .../internet_insights/__init__.py | 8 +- .../internet_insights/api/__init__.py | 4 +- ...internet_insights_catalog_providers_api.py | 657 ++++ .../api/internet_insights_outages_api.py | 958 ++++++ .../internet_insights/models/__init__.py | 4 +- .../models/api_application_outage_details.py | 12 +- .../models/api_network_outage_details.py | 12 +- .../internet_insights_api_affected_agent.py | 89 + .../internet_insights_api_affected_test.py | 89 + ...internet_insights_catalog_providers_api.py | 158 + .../test_internet_insights_outages_api.py | 248 ++ .../.openapi-generator/FILES | 6 +- thousandeyes-sdk-snapshots/README.md | 12 +- .../docs/TestSnapshotsApi.md | 100 + .../thousandeyes_sdk/snapshots/__init__.py | 2 +- .../snapshots/api/__init__.py | 2 +- .../snapshots/api/test_snapshots_api.py | 371 +++ .../test/test_test_snapshots_api.py | 119 + .../.openapi-generator/FILES | 4 + thousandeyes-sdk-streaming/README.md | 4 +- .../docs/CreateStreamResponse.md | 1 + .../docs/DataModelVersion.md | 2 +- .../docs/EndpointType.md | 2 +- .../docs/ExporterConfig.md | 30 + .../docs/ExporterConfigSplunkHec.md | 33 + .../docs/GetStreamResponse.md | 1 + thousandeyes-sdk-streaming/docs/PutStream.md | 1 + thousandeyes-sdk-streaming/docs/Stream.md | 1 + .../thousandeyes_sdk/streaming/__init__.py | 2 + .../streaming/models/__init__.py | 2 + .../models/create_stream_response.py | 8 +- .../streaming/models/data_model_version.py | 3 +- .../streaming/models/endpoint_type.py | 2 +- .../streaming/models/exporter_config.py | 91 + .../models/exporter_config_splunk_hec.py | 93 + .../streaming/models/get_stream_response.py | 8 +- .../streaming/models/put_stream.py | 10 +- .../streaming/models/stream.py | 8 +- .../test/test_streaming_api.py | 68 +- .../.openapi-generator/FILES | 4 +- thousandeyes-sdk-tags/README.md | 6 +- .../docs/ExpandTagsOptions.md | 11 + .../docs/TagAssignmentApi.md | 8 +- thousandeyes-sdk-tags/docs/TagsApi.md | 20 +- .../src/thousandeyes_sdk/tags/__init__.py | 2 +- .../tags/api/tag_assignment_api.py | 24 +- .../src/thousandeyes_sdk/tags/api/tags_api.py | 50 +- .../thousandeyes_sdk/tags/models/__init__.py | 2 +- .../tags/models/expand_tags_options.py | 35 + .../.openapi-generator/FILES | 84 +- thousandeyes-sdk-test-results/README.md | 54 +- .../docs/APITestResultsApi.md | 198 ++ .../docs/ApiDetailTestResult.md | 2 +- .../docs/ApiTestResult.md | 2 +- .../docs/BgpBasicTestResult.md | 2 +- .../docs/BgpTestResult.md | 2 +- .../docs/BgpTestRouteInformationResult.md | 2 +- .../docs/DNSSECTestResultsApi.md | 105 + .../docs/DNSServerTestResultsApi.md | 204 ++ .../docs/DNSTraceTestResultsApi.md | 105 + .../docs/DnsServerTestResult.md | 2 +- .../docs/DnsTraceTestResult.md | 2 +- .../docs/DnssecTestResult.md | 2 +- .../docs/FtpServerTestResult.md | 2 +- .../docs/HttpTestResult.md | 2 +- .../docs/NetworkBGPTestResultsApi.md | 198 ++ .../docs/NetworkTestResult.md | 2 +- .../docs/NetworkTestResultsApi.md | 304 ++ .../docs/PageLoadDetailTestResult.md | 2 +- .../docs/PageLoadTestResult.md | 2 +- .../docs/PathTrace.md | 34 + .../docs/PathVisBaseTestResult.md | 2 +- .../docs/PathVisDetailTestResult.md | 2 +- .../docs/PathVisTestResult.md | 4 +- .../docs/RtpStreamTestResult.md | 2 +- .../docs/SipServerTestResult.md | 2 +- .../docs/TestResultAgent.md | 32 + .../docs/TestResultMonitor.md | 31 + .../docs/VoiceRTPServerTestResultsApi.md | 105 + .../docs/VoiceSIPServerTestResultsApi.md | 105 + .../docs/WebFTPServerTestResultsApi.md | 105 + .../docs/WebHTTPServerTestResultsApi.md | 108 + .../docs/WebPageLoadTestResultsApi.md | 198 ++ .../docs/WebTransactionDetailTestResult.md | 2 +- .../WebTransactionPageDetailTestResult.md | 2 +- .../docs/WebTransactionTestResult.md | 2 +- .../docs/WebTransactionsTestResultsApi.md | 293 ++ .../thousandeyes_sdk/test_results/__init__.py | 30 +- .../test_results/api/__init__.py | 24 +- .../test_results/api/api_test_results_api.py | 760 +++++ .../api/dns_server_test_results_api.py | 830 ++++++ .../api/dns_trace_test_results_api.py | 429 +++ .../api/dnssec_test_results_api.py | 429 +++ .../api/network_bgp_test_results_api.py | 760 +++++ .../api/network_test_results_api.py | 1200 ++++++++ .../api/voice_rtp_server_test_results_api.py | 429 +++ .../api/voice_sip_server_test_results_api.py | 429 +++ .../api/web_ftp_server_test_results_api.py | 429 +++ .../api/web_http_server_test_results_api.py | 448 +++ .../api/web_page_load_test_results_api.py | 760 +++++ .../api/web_transactions_test_results_api.py | 1106 +++++++ .../test_results/models/__init__.py | 6 +- .../models/api_detail_test_result.py | 6 +- .../test_results/models/api_test_result.py | 6 +- .../models/bgp_basic_test_result.py | 6 +- .../test_results/models/bgp_test_result.py | 6 +- .../bgp_test_route_information_result.py | 6 +- .../models/dns_server_test_result.py | 6 +- .../models/dns_trace_test_result.py | 6 +- .../test_results/models/dnssec_test_result.py | 6 +- .../models/ftp_server_test_result.py | 6 +- .../test_results/models/http_test_result.py | 6 +- .../models/network_test_result.py | 6 +- .../models/page_load_detail_test_result.py | 6 +- .../models/page_load_test_result.py | 6 +- .../test_results/models/path_trace.py | 109 + .../models/path_vis_base_test_result.py | 6 +- .../models/path_vis_detail_test_result.py | 6 +- .../models/path_vis_test_result.py | 12 +- .../models/rtp_stream_test_result.py | 6 +- .../models/sip_server_test_result.py | 6 +- .../test_results/models/test_result_agent.py | 101 + .../models/test_result_monitor.py | 97 + .../web_transaction_detail_test_result.py | 6 +- ...web_transaction_page_detail_test_result.py | 6 +- .../models/web_transaction_test_result.py | 6 +- .../test/test_api_test_results_api.py | 389 +++ .../test/test_dns_server_test_results_api.py | 301 ++ .../test/test_dns_trace_test_results_api.py | 171 ++ .../test/test_dnssec_test_results_api.py | 161 + .../test/test_network_bgp_test_results_api.py | 281 ++ .../test/test_network_test_results_api.py | 549 ++++ .../test_voice_rtp_server_test_results_api.py | 179 ++ .../test_voice_sip_server_test_results_api.py | 189 ++ .../test_web_ftp_server_test_results_api.py | 183 ++ .../test_web_http_server_test_results_api.py | 239 ++ .../test_web_page_load_test_results_api.py | 735 +++++ .../test_web_transactions_test_results_api.py | 937 ++++++ .../.openapi-generator/FILES | 180 +- thousandeyes-sdk-tests/README.md | 194 +- thousandeyes-sdk-tests/docs/APITestsApi.md | 458 +++ thousandeyes-sdk-tests/docs/AgentResponse.md | 39 + .../docs/AgentToAgentInstantTest.md | 1 - .../docs/AgentToAgentTest.md | 1 - .../docs/AgentToAgentTestRequest.md | 62 + .../docs/AgentToAgentTestResponse.md | 62 + .../docs/AgentToAgentTestsApi.md | 458 +++ .../docs/AgentToServerInstantTest.md | 1 - .../docs/AgentToServerTest.md | 1 - .../docs/AgentToServerTestRequest.md | 64 + .../docs/AgentToServerTestResponse.md | 64 + .../docs/AgentToServerTestsApi.md | 458 +++ thousandeyes-sdk-tests/docs/ApiInstantTest.md | 4 +- thousandeyes-sdk-tests/docs/ApiProperties.md | 3 + thousandeyes-sdk-tests/docs/ApiTest.md | 4 +- thousandeyes-sdk-tests/docs/ApiTestRequest.md | 66 + .../docs/ApiTestResponse.md | 66 + thousandeyes-sdk-tests/docs/BGPTestsApi.md | 458 +++ thousandeyes-sdk-tests/docs/BgpTestRequest.md | 48 + .../docs/BgpTestResponse.md | 48 + thousandeyes-sdk-tests/docs/DNSSECTestsApi.md | 458 +++ .../docs/DNSServerTestsApi.md | 458 +++ .../docs/DNSTraceTestsApi.md | 458 +++ .../docs/DnsSecInstantTest.md | 1 - thousandeyes-sdk-tests/docs/DnsSecTest.md | 1 - .../docs/DnsSecTestRequest.md | 48 + .../docs/DnsSecTestResponse.md | 48 + .../docs/DnsServerInstantTest.md | 1 - thousandeyes-sdk-tests/docs/DnsServerTest.md | 1 - .../docs/DnsServerTestRequest.md | 63 + .../docs/DnsServerTestResponse.md | 63 + .../docs/DnsTraceInstantTest.md | 1 - thousandeyes-sdk-tests/docs/DnsTraceTest.md | 1 - .../docs/DnsTraceTestRequest.md | 49 + .../docs/DnsTraceTestResponse.md | 49 + .../docs/ExpandBgpTestOptions.md | 11 + .../docs/ExpandTestOptions.md | 11 + .../docs/FTPServerTestsApi.md | 456 +++ .../docs/FtpServerInstantTest.md | 1 - thousandeyes-sdk-tests/docs/FtpServerTest.md | 1 - .../docs/FtpServerTestRequest.md | 67 + .../docs/FtpServerTestResponse.md | 67 + .../docs/HTTPServerTestsApi.md | 458 +++ .../docs/HttpServerBaseProperties.md | 2 +- .../docs/HttpServerInstantTest.md | 3 +- .../docs/HttpServerProperties.md | 2 +- thousandeyes-sdk-tests/docs/HttpServerTest.md | 3 +- .../docs/HttpServerTestRequest.md | 86 + .../docs/HttpServerTestResponse.md | 86 + .../docs/PageLoadInstantTest.md | 3 +- .../docs/PageLoadProperties.md | 2 +- thousandeyes-sdk-tests/docs/PageLoadTest.md | 3 +- .../docs/PageLoadTestRequest.md | 94 + .../docs/PageLoadTestResponse.md | 94 + .../docs/PageLoadTestsApi.md | 458 +++ .../docs/SIPServerTestsApi.md | 456 +++ .../docs/SipServerInstantTest.md | 1 - thousandeyes-sdk-tests/docs/SipServerTest.md | 7 +- .../docs/SipServerTestRequest.md | 61 + .../docs/SipServerTestResponse.md | 66 + .../docs/TestAgentRequest.md | 30 + thousandeyes-sdk-tests/docs/TestRequest.md | 2 +- thousandeyes-sdk-tests/docs/TestsApi.md | 94 + .../docs/UnexpandedApiTest.md | 3 + .../docs/UnexpandedHttpServerTest.md | 2 +- .../docs/UnexpandedPageLoadTest.md | 2 +- .../docs/UnexpandedWebTransactionTest.md | 2 +- .../docs/UpdateSipServerTest.md | 9 +- .../docs/VoiceInstantTest.md | 1 - thousandeyes-sdk-tests/docs/VoiceTest.md | 1 - .../docs/VoiceTestRequest.md | 58 + .../docs/VoiceTestResponse.md | 58 + thousandeyes-sdk-tests/docs/VoiceTestsApi.md | 458 +++ .../docs/WebTransactionInstantTest.md | 3 +- .../docs/WebTransactionProperties.md | 2 +- .../docs/WebTransactionTest.md | 3 +- .../docs/WebTransactionTestRequest.md | 95 + .../docs/WebTransactionTestResponse.md | 95 + .../docs/WebTransactionTestsApi.md | 458 +++ .../src/thousandeyes_sdk/tests/__init__.py | 76 +- .../thousandeyes_sdk/tests/api/__init__.py | 28 +- .../tests/api/agent_to_agent_tests_api.py | 1615 ++++++++++ .../tests/api/agent_to_server_tests_api.py | 1615 ++++++++++ .../tests/api/api_tests_api.py | 1615 ++++++++++ .../tests/api/bgp_tests_api.py | 1616 ++++++++++ .../tests/api/dns_server_tests_api.py | 1615 ++++++++++ .../tests/api/dns_trace_tests_api.py | 1615 ++++++++++ .../tests/api/dnssec_tests_api.py | 1615 ++++++++++ .../tests/api/ftp_server_tests_api.py | 1612 ++++++++++ .../tests/api/http_server_tests_api.py | 1615 ++++++++++ .../tests/api/page_load_tests_api.py | 1615 ++++++++++ .../tests/api/sip_server_tests_api.py | 1612 ++++++++++ .../thousandeyes_sdk/tests/api/tests_api.py | 324 ++ .../tests/api/voice_tests_api.py | 1615 ++++++++++ .../tests/api/web_transaction_tests_api.py | 1615 ++++++++++ .../thousandeyes_sdk/tests/models/__init__.py | 48 +- .../tests/models/agent_response.py | 124 + .../models/agent_to_agent_instant_test.py | 16 +- .../tests/models/agent_to_agent_test.py | 14 +- .../models/agent_to_agent_test_request.py | 190 ++ .../models/agent_to_agent_test_response.py | 228 ++ .../models/agent_to_server_instant_test.py | 16 +- .../tests/models/agent_to_server_test.py | 14 +- .../models/agent_to_server_test_request.py | 195 ++ .../models/agent_to_server_test_response.py | 233 ++ .../tests/models/api_instant_test.py | 20 +- .../tests/models/api_properties.py | 8 +- .../thousandeyes_sdk/tests/models/api_test.py | 20 +- .../tests/models/api_test_request.py | 222 ++ .../tests/models/api_test_response.py | 250 ++ .../tests/models/bgp_test_request.py | 146 + .../tests/models/bgp_test_response.py | 184 ++ .../tests/models/dns_sec_instant_test.py | 16 +- .../tests/models/dns_sec_test.py | 16 +- .../tests/models/dns_sec_test_request.py | 156 + .../tests/models/dns_sec_test_response.py | 184 ++ .../tests/models/dns_server_instant_test.py | 16 +- .../tests/models/dns_server_test.py | 14 +- .../tests/models/dns_server_test_request.py | 192 ++ .../tests/models/dns_server_test_response.py | 238 ++ .../tests/models/dns_trace_instant_test.py | 16 +- .../tests/models/dns_trace_test.py | 16 +- .../tests/models/dns_trace_test_request.py | 159 + .../tests/models/dns_trace_test_response.py | 187 ++ .../tests/models/expand_bgp_test_options.py | 38 + .../tests/models/expand_test_options.py | 39 + .../tests/models/ftp_server_instant_test.py | 16 +- .../tests/models/ftp_server_test.py | 14 +- .../tests/models/ftp_server_test_request.py | 199 ++ .../tests/models/ftp_server_test_response.py | 237 ++ .../models/http_server_base_properties.py | 4 +- .../tests/models/http_server_instant_test.py | 20 +- .../tests/models/http_server_properties.py | 4 +- .../tests/models/http_server_test.py | 18 +- .../tests/models/http_server_test_request.py | 252 ++ .../tests/models/http_server_test_response.py | 290 ++ .../tests/models/page_load_instant_test.py | 20 +- .../tests/models/page_load_properties.py | 4 +- .../tests/models/page_load_test.py | 18 +- .../tests/models/page_load_test_request.py | 270 ++ .../tests/models/page_load_test_response.py | 308 ++ .../tests/models/sip_server_instant_test.py | 16 +- .../tests/models/sip_server_test.py | 44 +- .../tests/models/sip_server_test_request.py | 199 ++ .../tests/models/sip_server_test_response.py | 234 ++ .../tests/models/test_agent_request.py | 89 + .../tests/models/test_request.py | 6 +- .../tests/models/unexpanded_api_test.py | 8 +- .../models/unexpanded_http_server_test.py | 4 +- .../tests/models/unexpanded_page_load_test.py | 4 +- .../models/unexpanded_web_transaction_test.py | 4 +- .../tests/models/update_sip_server_test.py | 58 +- .../tests/models/voice_instant_test.py | 16 +- .../tests/models/voice_test.py | 14 +- .../tests/models/voice_test_request.py | 191 ++ .../tests/models/voice_test_response.py | 219 ++ .../models/web_transaction_instant_test.py | 18 +- .../models/web_transaction_properties.py | 4 +- .../tests/models/web_transaction_test.py | 18 +- .../models/web_transaction_test_request.py | 271 ++ .../models/web_transaction_test_response.py | 309 ++ .../test/test_agent_to_agent_tests_api.py | 702 +++++ .../test/test_agent_to_server_tests_api.py | 716 +++++ .../test/test_api_tests_api.py | 1274 ++++++++ .../test/test_bgp_tests_api.py | 521 ++++ .../test/test_dns_server_tests_api.py | 739 +++++ .../test/test_dns_trace_tests_api.py | 571 ++++ .../test/test_dnssec_tests_api.py | 564 ++++ .../test/test_ftp_server_tests_api.py | 737 +++++ .../test/test_http_server_tests_api.py | 1038 +++++++ .../test/test_page_load_tests_api.py | 1094 +++++++ .../test/test_sip_server_tests_api.py | 762 +++++ thousandeyes-sdk-tests/test/test_tests_api.py | 119 + .../test/test_voice_tests_api.py | 702 +++++ .../test/test_web_transaction_tests_api.py | 1099 +++++++ .../.openapi-generator/FILES | 12 +- thousandeyes-sdk-usage/README.md | 8 +- .../docs/EndpointAgentsUsage.md | 31 + .../docs/ExpandUsageOptions.md | 11 + thousandeyes-sdk-usage/docs/TestUsage.md | 35 + thousandeyes-sdk-usage/docs/UsageApi.md | 6 +- thousandeyes-sdk-usage/docs/UsageDetails.md | 4 +- thousandeyes-sdk-usage/docs/UsageQuota.md | 1 + .../src/thousandeyes_sdk/usage/__init__.py | 6 +- .../thousandeyes_sdk/usage/api/usage_api.py | 14 +- .../thousandeyes_sdk/usage/models/__init__.py | 6 +- .../usage/models/endpoint_agents_usage.py | 91 + .../usage/models/expand_usage_options.py | 40 + .../usage/models/test_usage.py | 99 + .../usage/models/usage_details.py | 12 +- .../usage/models/usage_quota.py | 4 +- thousandeyes-sdk-usage/test/test_usage_api.py | 1 + 858 files changed, 120605 insertions(+), 2726 deletions(-) create mode 100644 thousandeyes-sdk-administrative/docs/AgentResponse.md create mode 100644 thousandeyes-sdk-administrative/docs/ExpandAccountGroupOptions.md create mode 100644 thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/agent_response.py create mode 100644 thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/expand_account_group_options.py create mode 100644 thousandeyes-sdk-agents/docs/AgentLabel.md create mode 100644 thousandeyes-sdk-agents/docs/AgentNotification.md create mode 100644 thousandeyes-sdk-agents/docs/AgentProxiesApi.md create mode 100644 thousandeyes-sdk-agents/docs/AgentResponse.md create mode 100644 thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/agent_proxies_api.py create mode 100644 thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_label.py create mode 100644 thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_notification.py create mode 100644 thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_response.py create mode 100644 thousandeyes-sdk-agents/test/test_agent_proxies_api.py create mode 100644 thousandeyes-sdk-alerts/docs/AlertNotification.md create mode 100644 thousandeyes-sdk-alerts/docs/ExpandAlertTestOptions.md create mode 100644 thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/alert_notification.py create mode 100644 thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/expand_alert_test_options.py create mode 100644 thousandeyes-sdk-bgp-monitors/docs/BGPMonitorsApi.md create mode 100644 thousandeyes-sdk-bgp-monitors/src/thousandeyes_sdk/bgp_monitors/api/bgp_monitors_api.py create mode 100644 thousandeyes-sdk-bgp-monitors/test/test_bgp_monitors_api.py create mode 100644 thousandeyes-sdk-emulation/docs/ExpandEmulatedDeviceOptions.md create mode 100644 thousandeyes-sdk-emulation/src/thousandeyes_sdk/emulation/models/expand_emulated_device_options.py create mode 100644 thousandeyes-sdk-endpoint-agents/docs/EndpointAgentEthernetProfile.md create mode 100644 thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsApi.md create mode 100644 thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsTransferApi.md create mode 100644 thousandeyes-sdk-endpoint-agents/docs/ExpandEndpointAgentOptions.md create mode 100644 thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/api/endpoint_agents_api.py create mode 100644 thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/api/endpoint_agents_transfer_api.py create mode 100644 thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/endpoint_agent_ethernet_profile.py create mode 100644 thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/expand_endpoint_agent_options.py create mode 100644 thousandeyes-sdk-endpoint-agents/test/test_endpoint_agents_api.py create mode 100644 thousandeyes-sdk-endpoint-agents/test/test_endpoint_agents_transfer_api.py create mode 100644 thousandeyes-sdk-endpoint-instant-tests/docs/AgentToServerEndpointInstantScheduledTestsApi.md create mode 100644 thousandeyes-sdk-endpoint-instant-tests/docs/EndpointRunScheduledInstantTestResult.md create mode 100644 thousandeyes-sdk-endpoint-instant-tests/docs/HTTPServerEndpointInstantScheduledTestsApi.md create mode 100644 thousandeyes-sdk-endpoint-instant-tests/docs/RunEndpointInstantScheduledTestsApi.md create mode 100644 thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/api/agent_to_server_endpoint_instant_scheduled_tests_api.py create mode 100644 thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/api/http_server_endpoint_instant_scheduled_tests_api.py create mode 100644 thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/api/run_endpoint_instant_scheduled_tests_api.py create mode 100644 thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_run_scheduled_instant_test_result.py create mode 100644 thousandeyes-sdk-endpoint-instant-tests/test/test_agent_to_server_endpoint_instant_scheduled_tests_api.py create mode 100644 thousandeyes-sdk-endpoint-instant-tests/test/test_http_server_endpoint_instant_scheduled_tests_api.py create mode 100644 thousandeyes-sdk-endpoint-instant-tests/test/test_run_endpoint_instant_scheduled_tests_api.py create mode 100644 thousandeyes-sdk-endpoint-labels/docs/EndpointAgentLabelsApi.md create mode 100644 thousandeyes-sdk-endpoint-labels/docs/ExpandLabelOptions.md create mode 100644 thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/api/endpoint_agent_labels_api.py create mode 100644 thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/models/expand_label_options.py create mode 100644 thousandeyes-sdk-endpoint-labels/test/test_endpoint_agent_labels_api.py create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/DynamicBaseEndpointTestResult.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/DynamicEndpointTestWebex.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/DynamicEndpointTestsDataRoundSearch.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/DynamicEndpointTestsDataSearchFilter.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/EndpointPathTrace.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/EndpointPathVisHop.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/EndpointPathVisRoute.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/EndpointTestEthernetProfile.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/EndpointTestResult.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataRoundsSearch.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataSearchFilter.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataSearchSort.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataSearchSortKey.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataThresholdFilter.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataThresholdFilters.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/ExpandEndpointHttpServerOptions.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/HTTPServerEndpointScheduledTestResultsApi.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestResult.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestResultHeaders.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestResults.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataRoundsSearch.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataSearchFilter.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataSearchSort.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataSearchSortKey.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataThresholdFilter.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataThresholdFilters.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/HttpMultiEndpointTestResults.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/LocalNetworkEndpointTestResultsApi.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdEndpointTestsDataRoundsSearch.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdEndpointTestsDataSearchFilter.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdNetworkEndpointTestResults.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicEndpointTestResult.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicEndpointTestResults.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicEndpointTestResultsApi.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointScheduledTestResultsApi.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointTestResult.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointTestResults.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/PathVisBaseEndpointTestResult.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailDynamicEndpointTestResult.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailDynamicEndpointTestResults.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailEndpointTestResult.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailEndpointTestResults.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/PathVisDynamicEndpointTestResult.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/PathVisDynamicEndpointTestResults.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/PathVisEndpointTestResult.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/PathVisEndpointTestResults.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTest.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestBase.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestCoordinates.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestDetail.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestDetailResults.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestNetwork.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestNetworkResult.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestNetworkResults.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPage.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageDetailResult.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageResult.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageResults.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageTimings.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultRequestFilter.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResults.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultsApi.md create mode 100644 thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultsRequest.md create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/http_server_endpoint_scheduled_test_results_api.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/local_network_endpoint_test_results_api.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/network_dynamic_endpoint_test_results_api.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/network_endpoint_scheduled_test_results_api.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/real_user_endpoint_test_results_api.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/dynamic_base_endpoint_test_result.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/dynamic_endpoint_test_webex.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/dynamic_endpoint_tests_data_round_search.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/dynamic_endpoint_tests_data_search_filter.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_path_trace.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_path_vis_hop.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_path_vis_route.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test_ethernet_profile.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test_result.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_rounds_search.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_search_filter.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_search_sort.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_search_sort_key.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_threshold_filter.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_threshold_filters.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/expand_endpoint_http_server_options.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_test_result.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_test_result_headers.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_test_results.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_rounds_search.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_search_filter.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_search_sort.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_search_sort_key.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_threshold_filter.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_threshold_filters.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_multi_endpoint_test_results.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_endpoint_tests_data_rounds_search.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_endpoint_tests_data_search_filter.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_network_endpoint_test_results.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_dynamic_endpoint_test_result.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_dynamic_endpoint_test_results.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_endpoint_test_result.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_endpoint_test_results.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_base_endpoint_test_result.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_dynamic_endpoint_test_result.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_dynamic_endpoint_test_results.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_endpoint_test_result.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_endpoint_test_results.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_dynamic_endpoint_test_result.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_dynamic_endpoint_test_results.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_endpoint_test_result.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_endpoint_test_results.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_base.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_coordinates.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_detail.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_detail_results.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_network.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_network_result.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_network_results.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_detail_result.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_result.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_results.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_timings.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_result_request_filter.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_results.py create mode 100644 thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_results_request.py create mode 100644 thousandeyes-sdk-endpoint-test-results/test/test_http_server_endpoint_scheduled_test_results_api.py create mode 100644 thousandeyes-sdk-endpoint-test-results/test/test_local_network_endpoint_test_results_api.py create mode 100644 thousandeyes-sdk-endpoint-test-results/test/test_network_dynamic_endpoint_test_results_api.py create mode 100644 thousandeyes-sdk-endpoint-test-results/test/test_network_endpoint_scheduled_test_results_api.py create mode 100644 thousandeyes-sdk-endpoint-test-results/test/test_real_user_endpoint_test_results_api.py create mode 100644 thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointDynamicTestsApi.md create mode 100644 thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointScheduledTestsApi.md create mode 100644 thousandeyes-sdk-endpoint-tests/docs/EndpointScheduledTestsApi.md create mode 100644 thousandeyes-sdk-endpoint-tests/docs/HTTPServerEndpointScheduledTestsApi.md create mode 100644 thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/agent_to_server_endpoint_dynamic_tests_api.py create mode 100644 thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/agent_to_server_endpoint_scheduled_tests_api.py create mode 100644 thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/endpoint_scheduled_tests_api.py create mode 100644 thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/http_server_endpoint_scheduled_tests_api.py create mode 100644 thousandeyes-sdk-endpoint-tests/test/test_agent_to_server_endpoint_dynamic_tests_api.py create mode 100644 thousandeyes-sdk-endpoint-tests/test/test_agent_to_server_endpoint_scheduled_tests_api.py create mode 100644 thousandeyes-sdk-endpoint-tests/test/test_endpoint_scheduled_tests_api.py create mode 100644 thousandeyes-sdk-endpoint-tests/test/test_http_server_endpoint_scheduled_tests_api.py create mode 100644 thousandeyes-sdk-event-detection/docs/EventAlertSeverity.md create mode 100644 thousandeyes-sdk-event-detection/docs/EventApiAffectedAgent.md create mode 100644 thousandeyes-sdk-event-detection/docs/EventApiAffectedTest.md create mode 100644 thousandeyes-sdk-event-detection/docs/EventTestLinks.md create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_alert_severity.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_api_affected_agent.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_api_affected_test.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_test_links.py create mode 100644 thousandeyes-sdk-instant-tests/docs/APIInstantTestsApi.md create mode 100644 thousandeyes-sdk-instant-tests/docs/AgentResponse.md create mode 100644 thousandeyes-sdk-instant-tests/docs/AgentToAgentInstantTestResponse.md create mode 100644 thousandeyes-sdk-instant-tests/docs/AgentToAgentInstantTestsApi.md create mode 100644 thousandeyes-sdk-instant-tests/docs/AgentToServerInstantTestResponse.md create mode 100644 thousandeyes-sdk-instant-tests/docs/AgentToServerInstantTestsApi.md create mode 100644 thousandeyes-sdk-instant-tests/docs/ApiInstantTestResponse.md create mode 100644 thousandeyes-sdk-instant-tests/docs/DNSSECInstantTestsApi.md create mode 100644 thousandeyes-sdk-instant-tests/docs/DNSServerInstantTestsApi.md create mode 100644 thousandeyes-sdk-instant-tests/docs/DNSTraceInstantTestsApi.md create mode 100644 thousandeyes-sdk-instant-tests/docs/DnsSecInstantTestResponse.md create mode 100644 thousandeyes-sdk-instant-tests/docs/DnsServerInstantTestResponse.md create mode 100644 thousandeyes-sdk-instant-tests/docs/DnsTraceInstantTestResponse.md create mode 100644 thousandeyes-sdk-instant-tests/docs/ExpandInstantTestOptions.md create mode 100644 thousandeyes-sdk-instant-tests/docs/FTPServerInstantTestsApi.md create mode 100644 thousandeyes-sdk-instant-tests/docs/FtpServerInstantTestRequest.md create mode 100644 thousandeyes-sdk-instant-tests/docs/FtpServerInstantTestResponse.md create mode 100644 thousandeyes-sdk-instant-tests/docs/HTTPPageLoadInstantTestsApi.md create mode 100644 thousandeyes-sdk-instant-tests/docs/HTTPServerInstantTestsApi.md create mode 100644 thousandeyes-sdk-instant-tests/docs/HttpServerInstantTestResponse.md create mode 100644 thousandeyes-sdk-instant-tests/docs/InstantTestsApi.md create mode 100644 thousandeyes-sdk-instant-tests/docs/PageLoadInstantTestResponse.md create mode 100644 thousandeyes-sdk-instant-tests/docs/SIPServerInstantTestsApi.md create mode 100644 thousandeyes-sdk-instant-tests/docs/VoiceInstantTestResponse.md create mode 100644 thousandeyes-sdk-instant-tests/docs/VoiceInstantTestsApi.md create mode 100644 thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTestResponse.md create mode 100644 thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTestsApi.md create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/agent_to_agent_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/agent_to_server_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/api_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/dns_server_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/dns_trace_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/dnssec_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/ftp_server_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/http_page_load_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/http_server_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/sip_server_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/voice_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/web_transaction_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_response.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test_response.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test_response.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/api_instant_test_response.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_sec_instant_test_response.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_server_instant_test_response.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_trace_instant_test_response.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/expand_instant_test_options.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/ftp_server_instant_test_request.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/ftp_server_instant_test_response.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_instant_test_response.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/page_load_instant_test_response.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/voice_instant_test_response.py create mode 100644 thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/web_transaction_instant_test_response.py create mode 100644 thousandeyes-sdk-instant-tests/test/test_agent_to_agent_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/test/test_agent_to_server_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/test/test_api_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/test/test_dns_server_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/test/test_dns_trace_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/test/test_dnssec_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/test/test_ftp_server_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/test/test_http_page_load_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/test/test_http_server_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/test/test_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/test/test_sip_server_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/test/test_voice_instant_tests_api.py create mode 100644 thousandeyes-sdk-instant-tests/test/test_web_transaction_instant_tests_api.py create mode 100644 thousandeyes-sdk-internet-insights/docs/InternetInsightsApiAffectedAgent.md create mode 100644 thousandeyes-sdk-internet-insights/docs/InternetInsightsApiAffectedTest.md create mode 100644 thousandeyes-sdk-internet-insights/docs/InternetInsightsCatalogProvidersApi.md create mode 100644 thousandeyes-sdk-internet-insights/docs/InternetInsightsOutagesApi.md create mode 100644 thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/api/internet_insights_catalog_providers_api.py create mode 100644 thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/api/internet_insights_outages_api.py create mode 100644 thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/internet_insights_api_affected_agent.py create mode 100644 thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/internet_insights_api_affected_test.py create mode 100644 thousandeyes-sdk-internet-insights/test/test_internet_insights_catalog_providers_api.py create mode 100644 thousandeyes-sdk-internet-insights/test/test_internet_insights_outages_api.py create mode 100644 thousandeyes-sdk-snapshots/docs/TestSnapshotsApi.md create mode 100644 thousandeyes-sdk-snapshots/src/thousandeyes_sdk/snapshots/api/test_snapshots_api.py create mode 100644 thousandeyes-sdk-snapshots/test/test_test_snapshots_api.py create mode 100644 thousandeyes-sdk-streaming/docs/ExporterConfig.md create mode 100644 thousandeyes-sdk-streaming/docs/ExporterConfigSplunkHec.md create mode 100644 thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/exporter_config.py create mode 100644 thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/exporter_config_splunk_hec.py create mode 100644 thousandeyes-sdk-tags/docs/ExpandTagsOptions.md create mode 100644 thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/models/expand_tags_options.py create mode 100644 thousandeyes-sdk-test-results/docs/APITestResultsApi.md create mode 100644 thousandeyes-sdk-test-results/docs/DNSSECTestResultsApi.md create mode 100644 thousandeyes-sdk-test-results/docs/DNSServerTestResultsApi.md create mode 100644 thousandeyes-sdk-test-results/docs/DNSTraceTestResultsApi.md create mode 100644 thousandeyes-sdk-test-results/docs/NetworkBGPTestResultsApi.md create mode 100644 thousandeyes-sdk-test-results/docs/NetworkTestResultsApi.md create mode 100644 thousandeyes-sdk-test-results/docs/PathTrace.md create mode 100644 thousandeyes-sdk-test-results/docs/TestResultAgent.md create mode 100644 thousandeyes-sdk-test-results/docs/TestResultMonitor.md create mode 100644 thousandeyes-sdk-test-results/docs/VoiceRTPServerTestResultsApi.md create mode 100644 thousandeyes-sdk-test-results/docs/VoiceSIPServerTestResultsApi.md create mode 100644 thousandeyes-sdk-test-results/docs/WebFTPServerTestResultsApi.md create mode 100644 thousandeyes-sdk-test-results/docs/WebHTTPServerTestResultsApi.md create mode 100644 thousandeyes-sdk-test-results/docs/WebPageLoadTestResultsApi.md create mode 100644 thousandeyes-sdk-test-results/docs/WebTransactionsTestResultsApi.md create mode 100644 thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/api_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/dns_server_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/dns_trace_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/dnssec_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/network_bgp_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/network_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/voice_rtp_server_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/voice_sip_server_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/web_ftp_server_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/web_http_server_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/web_page_load_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/web_transactions_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/path_trace.py create mode 100644 thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/test_result_agent.py create mode 100644 thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/test_result_monitor.py create mode 100644 thousandeyes-sdk-test-results/test/test_api_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/test/test_dns_server_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/test/test_dns_trace_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/test/test_dnssec_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/test/test_network_bgp_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/test/test_network_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/test/test_voice_rtp_server_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/test/test_voice_sip_server_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/test/test_web_ftp_server_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/test/test_web_http_server_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/test/test_web_page_load_test_results_api.py create mode 100644 thousandeyes-sdk-test-results/test/test_web_transactions_test_results_api.py create mode 100644 thousandeyes-sdk-tests/docs/APITestsApi.md create mode 100644 thousandeyes-sdk-tests/docs/AgentResponse.md create mode 100644 thousandeyes-sdk-tests/docs/AgentToAgentTestRequest.md create mode 100644 thousandeyes-sdk-tests/docs/AgentToAgentTestResponse.md create mode 100644 thousandeyes-sdk-tests/docs/AgentToAgentTestsApi.md create mode 100644 thousandeyes-sdk-tests/docs/AgentToServerTestRequest.md create mode 100644 thousandeyes-sdk-tests/docs/AgentToServerTestResponse.md create mode 100644 thousandeyes-sdk-tests/docs/AgentToServerTestsApi.md create mode 100644 thousandeyes-sdk-tests/docs/ApiTestRequest.md create mode 100644 thousandeyes-sdk-tests/docs/ApiTestResponse.md create mode 100644 thousandeyes-sdk-tests/docs/BGPTestsApi.md create mode 100644 thousandeyes-sdk-tests/docs/BgpTestRequest.md create mode 100644 thousandeyes-sdk-tests/docs/BgpTestResponse.md create mode 100644 thousandeyes-sdk-tests/docs/DNSSECTestsApi.md create mode 100644 thousandeyes-sdk-tests/docs/DNSServerTestsApi.md create mode 100644 thousandeyes-sdk-tests/docs/DNSTraceTestsApi.md create mode 100644 thousandeyes-sdk-tests/docs/DnsSecTestRequest.md create mode 100644 thousandeyes-sdk-tests/docs/DnsSecTestResponse.md create mode 100644 thousandeyes-sdk-tests/docs/DnsServerTestRequest.md create mode 100644 thousandeyes-sdk-tests/docs/DnsServerTestResponse.md create mode 100644 thousandeyes-sdk-tests/docs/DnsTraceTestRequest.md create mode 100644 thousandeyes-sdk-tests/docs/DnsTraceTestResponse.md create mode 100644 thousandeyes-sdk-tests/docs/ExpandBgpTestOptions.md create mode 100644 thousandeyes-sdk-tests/docs/ExpandTestOptions.md create mode 100644 thousandeyes-sdk-tests/docs/FTPServerTestsApi.md create mode 100644 thousandeyes-sdk-tests/docs/FtpServerTestRequest.md create mode 100644 thousandeyes-sdk-tests/docs/FtpServerTestResponse.md create mode 100644 thousandeyes-sdk-tests/docs/HTTPServerTestsApi.md create mode 100644 thousandeyes-sdk-tests/docs/HttpServerTestRequest.md create mode 100644 thousandeyes-sdk-tests/docs/HttpServerTestResponse.md create mode 100644 thousandeyes-sdk-tests/docs/PageLoadTestRequest.md create mode 100644 thousandeyes-sdk-tests/docs/PageLoadTestResponse.md create mode 100644 thousandeyes-sdk-tests/docs/PageLoadTestsApi.md create mode 100644 thousandeyes-sdk-tests/docs/SIPServerTestsApi.md create mode 100644 thousandeyes-sdk-tests/docs/SipServerTestRequest.md create mode 100644 thousandeyes-sdk-tests/docs/SipServerTestResponse.md create mode 100644 thousandeyes-sdk-tests/docs/TestAgentRequest.md create mode 100644 thousandeyes-sdk-tests/docs/TestsApi.md create mode 100644 thousandeyes-sdk-tests/docs/VoiceTestRequest.md create mode 100644 thousandeyes-sdk-tests/docs/VoiceTestResponse.md create mode 100644 thousandeyes-sdk-tests/docs/VoiceTestsApi.md create mode 100644 thousandeyes-sdk-tests/docs/WebTransactionTestRequest.md create mode 100644 thousandeyes-sdk-tests/docs/WebTransactionTestResponse.md create mode 100644 thousandeyes-sdk-tests/docs/WebTransactionTestsApi.md create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/agent_to_agent_tests_api.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/agent_to_server_tests_api.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/api_tests_api.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/bgp_tests_api.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/dns_server_tests_api.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/dns_trace_tests_api.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/dnssec_tests_api.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/ftp_server_tests_api.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/http_server_tests_api.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/page_load_tests_api.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/sip_server_tests_api.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/tests_api.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/voice_tests_api.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/web_transaction_tests_api.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_response.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_agent_test_request.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_agent_test_response.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_test_request.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_test_response.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_test_request.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_test_response.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/bgp_test_request.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/bgp_test_response.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_sec_test_request.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_sec_test_response.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_server_test_request.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_server_test_response.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_trace_test_request.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_trace_test_response.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/expand_bgp_test_options.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/expand_test_options.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/ftp_server_test_request.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/ftp_server_test_response.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_test_request.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_test_response.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_test_request.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_test_response.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/sip_server_test_request.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/sip_server_test_response.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/test_agent_request.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/voice_test_request.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/voice_test_response.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_test_request.py create mode 100644 thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_test_response.py create mode 100644 thousandeyes-sdk-tests/test/test_agent_to_agent_tests_api.py create mode 100644 thousandeyes-sdk-tests/test/test_agent_to_server_tests_api.py create mode 100644 thousandeyes-sdk-tests/test/test_api_tests_api.py create mode 100644 thousandeyes-sdk-tests/test/test_bgp_tests_api.py create mode 100644 thousandeyes-sdk-tests/test/test_dns_server_tests_api.py create mode 100644 thousandeyes-sdk-tests/test/test_dns_trace_tests_api.py create mode 100644 thousandeyes-sdk-tests/test/test_dnssec_tests_api.py create mode 100644 thousandeyes-sdk-tests/test/test_ftp_server_tests_api.py create mode 100644 thousandeyes-sdk-tests/test/test_http_server_tests_api.py create mode 100644 thousandeyes-sdk-tests/test/test_page_load_tests_api.py create mode 100644 thousandeyes-sdk-tests/test/test_sip_server_tests_api.py create mode 100644 thousandeyes-sdk-tests/test/test_tests_api.py create mode 100644 thousandeyes-sdk-tests/test/test_voice_tests_api.py create mode 100644 thousandeyes-sdk-tests/test/test_web_transaction_tests_api.py create mode 100644 thousandeyes-sdk-usage/docs/EndpointAgentsUsage.md create mode 100644 thousandeyes-sdk-usage/docs/ExpandUsageOptions.md create mode 100644 thousandeyes-sdk-usage/docs/TestUsage.md create mode 100644 thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/endpoint_agents_usage.py create mode 100644 thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/expand_usage_options.py create mode 100644 thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/test_usage.py diff --git a/thousandeyes-sdk-administrative/.openapi-generator/FILES b/thousandeyes-sdk-administrative/.openapi-generator/FILES index 4ab66cae7..c473353c7 100644 --- a/thousandeyes-sdk-administrative/.openapi-generator/FILES +++ b/thousandeyes-sdk-administrative/.openapi-generator/FILES @@ -8,8 +8,8 @@ docs/AccountGroupRequest.md docs/AccountGroupRole.md docs/AccountGroups.md docs/AccountGroupsApi.md -docs/Agent.md docs/AgentBase.md +docs/AgentResponse.md docs/AuditUserEvents.md docs/BaseRole.md docs/CloudEnterpriseAgentType.md @@ -23,7 +23,7 @@ docs/EnterpriseAgentState.md docs/Error.md docs/ErrorDetail.md docs/ErrorDetailCode.md -docs/Expand.md +docs/ExpandAccountGroupOptions.md docs/ExtendedUser.md docs/InterfaceIpMapping.md docs/Link.md @@ -67,8 +67,8 @@ src/thousandeyes_sdk/administrative/models/account_group_info.py src/thousandeyes_sdk/administrative/models/account_group_request.py src/thousandeyes_sdk/administrative/models/account_group_role.py src/thousandeyes_sdk/administrative/models/account_groups.py -src/thousandeyes_sdk/administrative/models/agent.py src/thousandeyes_sdk/administrative/models/agent_base.py +src/thousandeyes_sdk/administrative/models/agent_response.py src/thousandeyes_sdk/administrative/models/audit_user_events.py src/thousandeyes_sdk/administrative/models/base_role.py src/thousandeyes_sdk/administrative/models/cloud_enterprise_agent_type.py @@ -82,7 +82,7 @@ src/thousandeyes_sdk/administrative/models/enterprise_agent_state.py src/thousandeyes_sdk/administrative/models/error.py src/thousandeyes_sdk/administrative/models/error_detail.py src/thousandeyes_sdk/administrative/models/error_detail_code.py -src/thousandeyes_sdk/administrative/models/expand.py +src/thousandeyes_sdk/administrative/models/expand_account_group_options.py src/thousandeyes_sdk/administrative/models/extended_user.py src/thousandeyes_sdk/administrative/models/interface_ip_mapping.py src/thousandeyes_sdk/administrative/models/link.py diff --git a/thousandeyes-sdk-administrative/README.md b/thousandeyes-sdk-administrative/README.md index f7175d0a0..b24fcdeb5 100644 --- a/thousandeyes-sdk-administrative/README.md +++ b/thousandeyes-sdk-administrative/README.md @@ -12,7 +12,7 @@ This API provides the following endpoints that define the operations to manage y This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -86,7 +86,7 @@ with thousandeyes_sdk.core.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = thousandeyes_sdk.administrative.AccountGroupsApi(api_client) account_group_request = thousandeyes_sdk.administrative.AccountGroupRequest() # AccountGroupRequest | - expand = [thousandeyes_sdk.administrative.Expand()] # List[Expand] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional) + expand = [thousandeyes_sdk.administrative.ExpandAccountGroupOptions()] # List[ExpandAccountGroupOptions] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional) try: # Create account group @@ -118,6 +118,7 @@ Class | Method | HTTP request | Description *UserEventsApi* | [**get_user_events**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/UserEventsApi.md#get_user_events) | **GET** /audit-user-events | List activity log events *UsersApi* | [**create_user**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/UsersApi.md#create_user) | **POST** /users | Create user *UsersApi* | [**delete_user**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/UsersApi.md#delete_user) | **DELETE** /users/{id} | Delete user +*UsersApi* | [**get_current_user**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/UsersApi.md#get_current_user) | **GET** /users/current | Retrieve current user *UsersApi* | [**get_user**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/UsersApi.md#get_user) | **GET** /users/{id} | Retrieve user *UsersApi* | [**get_users**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/UsersApi.md#get_users) | **GET** /users | List users *UsersApi* | [**update_user**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/UsersApi.md#update_user) | **PUT** /users/{id} | Update user @@ -131,8 +132,8 @@ Class | Method | HTTP request | Description - [AccountGroupRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/AccountGroupRequest.md) - [AccountGroupRole](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/AccountGroupRole.md) - [AccountGroups](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/AccountGroups.md) - - [Agent](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/Agent.md) - [AgentBase](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/AgentBase.md) + - [AgentResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/AgentResponse.md) - [AuditUserEvents](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/AuditUserEvents.md) - [BaseRole](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/BaseRole.md) - [CloudEnterpriseAgentType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/CloudEnterpriseAgentType.md) @@ -146,7 +147,7 @@ Class | Method | HTTP request | Description - [Error](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/Error.md) - [ErrorDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/ErrorDetail.md) - [ErrorDetailCode](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/ErrorDetailCode.md) - - [Expand](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/Expand.md) + - [ExpandAccountGroupOptions](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/ExpandAccountGroupOptions.md) - [ExtendedUser](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/ExtendedUser.md) - [InterfaceIpMapping](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/InterfaceIpMapping.md) - [Link](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/Link.md) diff --git a/thousandeyes-sdk-administrative/docs/AccountGroupDetail.md b/thousandeyes-sdk-administrative/docs/AccountGroupDetail.md index da02182dd..970ceaf37 100644 --- a/thousandeyes-sdk-administrative/docs/AccountGroupDetail.md +++ b/thousandeyes-sdk-administrative/docs/AccountGroupDetail.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **users** | [**List[UserAccountGroup]**](UserAccountGroup.md) | | [optional] **links** | [**SelfLinks**](SelfLinks.md) | | [optional] **agents** | [**List[EnterpriseAgent]**](EnterpriseAgent.md) | | [optional] +**account_token** | **str** | The account group token is an alphanumeric string used to bind an Enterprise Agent to a specific account group. This token is not a password that must be kept secret. You can retrieve your `AccountGroupToken` from the `/account-groups/{id}` endpoint. | [optional] ## Example diff --git a/thousandeyes-sdk-administrative/docs/AccountGroupsApi.md b/thousandeyes-sdk-administrative/docs/AccountGroupsApi.md index 63545f14f..0c3f5a72d 100644 --- a/thousandeyes-sdk-administrative/docs/AccountGroupsApi.md +++ b/thousandeyes-sdk-administrative/docs/AccountGroupsApi.md @@ -26,7 +26,7 @@ Creates a new account group. This operation requires the `Edit all account group import thousandeyes_sdk.administrative from thousandeyes_sdk.administrative.models.account_group_request import AccountGroupRequest from thousandeyes_sdk.administrative.models.created_account_group import CreatedAccountGroup -from thousandeyes_sdk.administrative.models.expand import Expand +from thousandeyes_sdk.administrative.models.expand_account_group_options import ExpandAccountGroupOptions from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint @@ -51,7 +51,7 @@ with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = thousandeyes_sdk.administrative.AccountGroupsApi(api_client) account_group_request = thousandeyes_sdk.administrative.AccountGroupRequest() # AccountGroupRequest | - expand = [thousandeyes_sdk.administrative.Expand()] # List[Expand] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional) + expand = [thousandeyes_sdk.administrative.ExpandAccountGroupOptions()] # List[ExpandAccountGroupOptions] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional) try: # Create account group @@ -70,7 +70,7 @@ with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **account_group_request** | [**AccountGroupRequest**](AccountGroupRequest.md)| | - **expand** | [**List[Expand]**](Expand.md)| Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. | [optional] + **expand** | [**List[ExpandAccountGroupOptions]**](ExpandAccountGroupOptions.md)| Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. | [optional] ### Return type @@ -194,7 +194,7 @@ Retrieves detailed information about an account group using its ID. This operat ```python import thousandeyes_sdk.administrative from thousandeyes_sdk.administrative.models.account_group_detail import AccountGroupDetail -from thousandeyes_sdk.administrative.models.expand import Expand +from thousandeyes_sdk.administrative.models.expand_account_group_options import ExpandAccountGroupOptions from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint @@ -219,7 +219,7 @@ with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = thousandeyes_sdk.administrative.AccountGroupsApi(api_client) id = '1234' # str | Identifier for the account group. - expand = [thousandeyes_sdk.administrative.Expand()] # List[Expand] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional) + expand = [thousandeyes_sdk.administrative.ExpandAccountGroupOptions()] # List[ExpandAccountGroupOptions] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional) try: # Retrieve account group @@ -238,7 +238,7 @@ with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| Identifier for the account group. | - **expand** | [**List[Expand]**](Expand.md)| Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. | [optional] + **expand** | [**List[ExpandAccountGroupOptions]**](ExpandAccountGroupOptions.md)| Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. | [optional] ### Return type @@ -366,7 +366,7 @@ Updates an account group using its ID. You can modify the account group’s name import thousandeyes_sdk.administrative from thousandeyes_sdk.administrative.models.account_group_detail import AccountGroupDetail from thousandeyes_sdk.administrative.models.account_group_request import AccountGroupRequest -from thousandeyes_sdk.administrative.models.expand import Expand +from thousandeyes_sdk.administrative.models.expand_account_group_options import ExpandAccountGroupOptions from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint @@ -392,7 +392,7 @@ with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: api_instance = thousandeyes_sdk.administrative.AccountGroupsApi(api_client) id = '1234' # str | Identifier for the account group. account_group_request = thousandeyes_sdk.administrative.AccountGroupRequest() # AccountGroupRequest | - expand = [thousandeyes_sdk.administrative.Expand()] # List[Expand] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional) + expand = [thousandeyes_sdk.administrative.ExpandAccountGroupOptions()] # List[ExpandAccountGroupOptions] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional) try: # Update account group @@ -412,7 +412,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| Identifier for the account group. | **account_group_request** | [**AccountGroupRequest**](AccountGroupRequest.md)| | - **expand** | [**List[Expand]**](Expand.md)| Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. | [optional] + **expand** | [**List[ExpandAccountGroupOptions]**](ExpandAccountGroupOptions.md)| Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. | [optional] ### Return type diff --git a/thousandeyes-sdk-administrative/docs/AgentResponse.md b/thousandeyes-sdk-administrative/docs/AgentResponse.md new file mode 100644 index 000000000..78c5731ca --- /dev/null +++ b/thousandeyes-sdk-administrative/docs/AgentResponse.md @@ -0,0 +1,39 @@ +# AgentResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly] +**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly] +**network** | **str** | Network (including ASN) of agent’s public IP. | [optional] [readonly] +**agent_id** | **str** | Unique ID of the agent. | [optional] [readonly] +**agent_name** | **str** | Name of the agent. | [optional] +**location** | **str** | Location of the agent. | [optional] [readonly] +**country_id** | **str** | 2-digit ISO country code | [optional] [readonly] +**enabled** | **bool** | Flag indicating if the agent is enabled. | [optional] +**prefix** | **str** | Prefix containing agents public IP address. | [optional] [readonly] +**verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly] +**agent_type** | [**CloudEnterpriseAgentType**](CloudEnterpriseAgentType.md) | | + +## Example + +```python +from thousandeyes_sdk.administrative.models.agent_response import AgentResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentResponse from a JSON string +agent_response_instance = AgentResponse.from_json(json) +# print the JSON string representation of the object +print(AgentResponse.to_json()) + +# convert the object into a dict +agent_response_dict = agent_response_instance.to_dict() +# create an instance of AgentResponse from a dict +agent_response_from_dict = AgentResponse.from_dict(agent_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-administrative/docs/ExpandAccountGroupOptions.md b/thousandeyes-sdk-administrative/docs/ExpandAccountGroupOptions.md new file mode 100644 index 000000000..47036c84f --- /dev/null +++ b/thousandeyes-sdk-administrative/docs/ExpandAccountGroupOptions.md @@ -0,0 +1,11 @@ +# ExpandAccountGroupOptions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-administrative/docs/UsersApi.md b/thousandeyes-sdk-administrative/docs/UsersApi.md index 5a64e4938..db3eab042 100644 --- a/thousandeyes-sdk-administrative/docs/UsersApi.md +++ b/thousandeyes-sdk-administrative/docs/UsersApi.md @@ -6,6 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**create_user**](UsersApi.md#create_user) | **POST** /users | Create user [**delete_user**](UsersApi.md#delete_user) | **DELETE** /users/{id} | Delete user +[**get_current_user**](UsersApi.md#get_current_user) | **GET** /users/current | Retrieve current user [**get_user**](UsersApi.md#get_user) | **GET** /users/{id} | Retrieve user [**get_users**](UsersApi.md#get_users) | **GET** /users | List users [**update_user**](UsersApi.md#update_user) | **PUT** /users/{id} | Update user @@ -181,6 +182,86 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_current_user** +> UserDetail get_current_user() + +Retrieve current user + +Retrieves detailed information about the current user. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.models.user_detail import UserDetail +from thousandeyes_sdk.administrative.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.administrative.UsersApi(api_client) + + try: + # Retrieve current user + api_response = api_instance.get_current_user() + print("The response of UsersApi->get_current_user:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersApi->get_current_user: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**UserDetail**](UserDetail.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_user** > UserDetail get_user(id, aid=aid) diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/__init__.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/__init__.py index 841b7bc1e..d71378ae8 100644 --- a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/__init__.py +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/__init__.py @@ -28,8 +28,8 @@ from thousandeyes_sdk.administrative.models.account_group_request import AccountGroupRequest from thousandeyes_sdk.administrative.models.account_group_role import AccountGroupRole from thousandeyes_sdk.administrative.models.account_groups import AccountGroups -from thousandeyes_sdk.administrative.models.agent import Agent from thousandeyes_sdk.administrative.models.agent_base import AgentBase +from thousandeyes_sdk.administrative.models.agent_response import AgentResponse from thousandeyes_sdk.administrative.models.audit_user_events import AuditUserEvents from thousandeyes_sdk.administrative.models.base_role import BaseRole from thousandeyes_sdk.administrative.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType @@ -43,7 +43,7 @@ from thousandeyes_sdk.administrative.models.error import Error from thousandeyes_sdk.administrative.models.error_detail import ErrorDetail from thousandeyes_sdk.administrative.models.error_detail_code import ErrorDetailCode -from thousandeyes_sdk.administrative.models.expand import Expand +from thousandeyes_sdk.administrative.models.expand_account_group_options import ExpandAccountGroupOptions from thousandeyes_sdk.administrative.models.extended_user import ExtendedUser from thousandeyes_sdk.administrative.models.interface_ip_mapping import InterfaceIpMapping from thousandeyes_sdk.administrative.models.link import Link diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/account_groups_api.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/account_groups_api.py index c5073b206..7e5aa3ba1 100644 --- a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/account_groups_api.py +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/account_groups_api.py @@ -25,7 +25,7 @@ from thousandeyes_sdk.administrative.models.account_group_request import AccountGroupRequest from thousandeyes_sdk.administrative.models.account_groups import AccountGroups from thousandeyes_sdk.administrative.models.created_account_group import CreatedAccountGroup -from thousandeyes_sdk.administrative.models.expand import Expand +from thousandeyes_sdk.administrative.models.expand_account_group_options import ExpandAccountGroupOptions from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized from thousandeyes_sdk.core.api_response import ApiResponse @@ -50,7 +50,7 @@ def __init__(self, api_client=None) -> None: def create_account_group( self, account_group_request: AccountGroupRequest, - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, + expand: Annotated[Optional[List[ExpandAccountGroupOptions]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -71,7 +71,7 @@ def create_account_group( :param account_group_request: (required) :type account_group_request: AccountGroupRequest :param expand: Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. - :type expand: List[Expand] + :type expand: List[ExpandAccountGroupOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -128,7 +128,7 @@ def create_account_group( def create_account_group_with_http_info( self, account_group_request: AccountGroupRequest, - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, + expand: Annotated[Optional[List[ExpandAccountGroupOptions]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -149,7 +149,7 @@ def create_account_group_with_http_info( :param account_group_request: (required) :type account_group_request: AccountGroupRequest :param expand: Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. - :type expand: List[Expand] + :type expand: List[ExpandAccountGroupOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -206,7 +206,7 @@ def create_account_group_with_http_info( def create_account_group_without_preload_content( self, account_group_request: AccountGroupRequest, - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, + expand: Annotated[Optional[List[ExpandAccountGroupOptions]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -227,7 +227,7 @@ def create_account_group_without_preload_content( :param account_group_request: (required) :type account_group_request: AccountGroupRequest :param expand: Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. - :type expand: List[Expand] + :type expand: List[ExpandAccountGroupOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -640,7 +640,7 @@ def _delete_account_group_serialize( def get_account_group( self, id: Annotated[StrictStr, Field(description="Identifier for the account group.")], - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, + expand: Annotated[Optional[List[ExpandAccountGroupOptions]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -661,7 +661,7 @@ def get_account_group( :param id: Identifier for the account group. (required) :type id: str :param expand: Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. - :type expand: List[Expand] + :type expand: List[ExpandAccountGroupOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -718,7 +718,7 @@ def get_account_group( def get_account_group_with_http_info( self, id: Annotated[StrictStr, Field(description="Identifier for the account group.")], - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, + expand: Annotated[Optional[List[ExpandAccountGroupOptions]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -739,7 +739,7 @@ def get_account_group_with_http_info( :param id: Identifier for the account group. (required) :type id: str :param expand: Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. - :type expand: List[Expand] + :type expand: List[ExpandAccountGroupOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -796,7 +796,7 @@ def get_account_group_with_http_info( def get_account_group_without_preload_content( self, id: Annotated[StrictStr, Field(description="Identifier for the account group.")], - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, + expand: Annotated[Optional[List[ExpandAccountGroupOptions]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -817,7 +817,7 @@ def get_account_group_without_preload_content( :param id: Identifier for the account group. (required) :type id: str :param expand: Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. - :type expand: List[Expand] + :type expand: List[ExpandAccountGroupOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1221,7 +1221,7 @@ def update_account_group( self, id: Annotated[StrictStr, Field(description="Identifier for the account group.")], account_group_request: AccountGroupRequest, - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, + expand: Annotated[Optional[List[ExpandAccountGroupOptions]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1244,7 +1244,7 @@ def update_account_group( :param account_group_request: (required) :type account_group_request: AccountGroupRequest :param expand: Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. - :type expand: List[Expand] + :type expand: List[ExpandAccountGroupOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1303,7 +1303,7 @@ def update_account_group_with_http_info( self, id: Annotated[StrictStr, Field(description="Identifier for the account group.")], account_group_request: AccountGroupRequest, - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, + expand: Annotated[Optional[List[ExpandAccountGroupOptions]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1326,7 +1326,7 @@ def update_account_group_with_http_info( :param account_group_request: (required) :type account_group_request: AccountGroupRequest :param expand: Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. - :type expand: List[Expand] + :type expand: List[ExpandAccountGroupOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1385,7 +1385,7 @@ def update_account_group_without_preload_content( self, id: Annotated[StrictStr, Field(description="Identifier for the account group.")], account_group_request: AccountGroupRequest, - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, + expand: Annotated[Optional[List[ExpandAccountGroupOptions]], Field(description="Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1408,7 +1408,7 @@ def update_account_group_without_preload_content( :param account_group_request: (required) :type account_group_request: AccountGroupRequest :param expand: Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. - :type expand: List[Expand] + :type expand: List[ExpandAccountGroupOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/users_api.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/users_api.py index 7814e32b9..6a5585b39 100644 --- a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/users_api.py +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/users_api.py @@ -651,6 +651,271 @@ def _delete_user_serialize( + @validate_call + def get_current_user( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserDetail: + """Retrieve current user + + Retrieves detailed information about the current user. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_current_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def get_current_user_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserDetail]: + """Retrieve current user + + Retrieves detailed information about the current user. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_current_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def get_current_user_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve current user + + Retrieves detailed information about the current user. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_current_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_current_user_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/users/current', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_user( self, diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/__init__.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/__init__.py index 76729432d..1bb2131f1 100644 --- a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/__init__.py +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/__init__.py @@ -19,8 +19,8 @@ from thousandeyes_sdk.administrative.models.account_group_request import AccountGroupRequest from thousandeyes_sdk.administrative.models.account_group_role import AccountGroupRole from thousandeyes_sdk.administrative.models.account_groups import AccountGroups -from thousandeyes_sdk.administrative.models.agent import Agent from thousandeyes_sdk.administrative.models.agent_base import AgentBase +from thousandeyes_sdk.administrative.models.agent_response import AgentResponse from thousandeyes_sdk.administrative.models.audit_user_events import AuditUserEvents from thousandeyes_sdk.administrative.models.base_role import BaseRole from thousandeyes_sdk.administrative.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType @@ -34,7 +34,7 @@ from thousandeyes_sdk.administrative.models.error import Error from thousandeyes_sdk.administrative.models.error_detail import ErrorDetail from thousandeyes_sdk.administrative.models.error_detail_code import ErrorDetailCode -from thousandeyes_sdk.administrative.models.expand import Expand +from thousandeyes_sdk.administrative.models.expand_account_group_options import ExpandAccountGroupOptions from thousandeyes_sdk.administrative.models.extended_user import ExtendedUser from thousandeyes_sdk.administrative.models.interface_ip_mapping import InterfaceIpMapping from thousandeyes_sdk.administrative.models.link import Link diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group_detail.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group_detail.py index 62a267d88..7cc762a1d 100644 --- a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group_detail.py +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group_detail.py @@ -36,7 +36,8 @@ class AccountGroupDetail(BaseModel): users: Optional[List[UserAccountGroup]] = None links: Optional[SelfLinks] = Field(default=None, alias="_links") agents: Optional[List[EnterpriseAgent]] = None - __properties: ClassVar[List[str]] = ["aid", "accountGroupName", "isCurrentAccountGroup", "isDefaultAccountGroup", "organizationName", "users", "_links", "agents"] + account_token: Optional[StrictStr] = Field(default=None, description="The account group token is an alphanumeric string used to bind an Enterprise Agent to a specific account group. This token is not a password that must be kept secret. You can retrieve your `AccountGroupToken` from the `/account-groups/{id}` endpoint.", alias="accountToken") + __properties: ClassVar[List[str]] = ["aid", "accountGroupName", "isCurrentAccountGroup", "isDefaultAccountGroup", "organizationName", "users", "_links", "agents", "accountToken"] model_config = ConfigDict( populate_by_name=True, @@ -114,7 +115,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "organizationName": obj.get("organizationName"), "users": [UserAccountGroup.from_dict(_item) for _item in obj["users"]] if obj.get("users") is not None else None, "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, - "agents": [EnterpriseAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "agents": [EnterpriseAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, + "accountToken": obj.get("accountToken") }) return _obj diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/agent_response.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/agent_response.py new file mode 100644 index 000000000..522bae7bd --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/agent_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Administrative API + + Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.administrative.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from typing import Optional, Set +from typing_extensions import Self + +class AgentResponse(BaseModel): + """ + AgentResponse + """ # noqa: E501 + ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses") + public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses") + network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agent’s public IP.") + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the agent.", alias="agentId") + agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent.", alias="agentName") + location: Optional[StrictStr] = Field(default=None, description="Location of the agent.") + country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code", alias="countryId") + enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.") + prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.") + verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates") + agent_type: CloudEnterpriseAgentType = Field(alias="agentType") + __properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "agentType"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "ip_addresses", + "public_ip_addresses", + "network", + "agent_id", + "location", + "country_id", + "prefix", + "verify_ssl_certificates", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ipAddresses": obj.get("ipAddresses"), + "publicIpAddresses": obj.get("publicIpAddresses"), + "network": obj.get("network"), + "agentId": obj.get("agentId"), + "agentName": obj.get("agentName"), + "location": obj.get("location"), + "countryId": obj.get("countryId"), + "enabled": obj.get("enabled"), + "prefix": obj.get("prefix"), + "verifySslCertificates": obj.get("verifySslCertificates"), + "agentType": obj.get("agentType") + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/expand_account_group_options.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/expand_account_group_options.py new file mode 100644 index 000000000..f379ec936 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/expand_account_group_options.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + Administrative API + + Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ExpandAccountGroupOptions(str, Enum): + """ + ExpandAccountGroupOptions + """ + + """ + allowed enum values + """ + USER = 'user' + AGENT = 'agent' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ExpandAccountGroupOptions from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-administrative/test/test_account_groups_api.py b/thousandeyes-sdk-administrative/test/test_account_groups_api.py index 56b2d3442..55b666d37 100644 --- a/thousandeyes-sdk-administrative/test/test_account_groups_api.py +++ b/thousandeyes-sdk-administrative/test/test_account_groups_api.py @@ -125,6 +125,7 @@ def test_get_account_group_models_validation(self) -> None: }, "accountGroupName" : "Account A", "isDefaultAccountGroup" : true, + "accountToken" : "6j052y4vfgyuhefghue", "aid" : "1234", "users" : [ { "uid" : "235", @@ -388,6 +389,7 @@ def test_update_account_group_models_validation(self) -> None: }, "accountGroupName" : "Account A", "isDefaultAccountGroup" : true, + "accountToken" : "6j052y4vfgyuhefghue", "aid" : "1234", "users" : [ { "uid" : "235", diff --git a/thousandeyes-sdk-administrative/test/test_users_api.py b/thousandeyes-sdk-administrative/test/test_users_api.py index f9cdd4c3c..000933429 100644 --- a/thousandeyes-sdk-administrative/test/test_users_api.py +++ b/thousandeyes-sdk-administrative/test/test_users_api.py @@ -125,6 +125,82 @@ def test_delete_user_models_validation(self) -> None: """Test case for delete_user request and response models""" + def test_get_current_user_models_validation(self) -> None: + """Test case for get_current_user request and response models""" + + response_body_json = """ + { + "loginAccountGroup" : { + "accountGroupName" : "Account A", + "aid" : "1234" + }, + "uid" : "245", + "lastLogin" : "2022-07-17T22:00:54Z", + "allAccountGroupRoles" : [ { + "roleId" : "35", + "name" : "Organization Admin", + "isBuiltin" : true, + "hasManagementPermissions" : true + }, { + "roleId" : "35", + "name" : "Organization Admin", + "isBuiltin" : true, + "hasManagementPermissions" : true + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "accountGroupRoles" : [ { + "roles" : [ { + "roleId" : "35", + "name" : "Organization Admin", + "isBuiltin" : true, + "hasManagementPermissions" : true + }, { + "roleId" : "35", + "name" : "Organization Admin", + "isBuiltin" : true, + "hasManagementPermissions" : true + } ], + "accountGroup" : { + "accountGroupName" : "Account A", + "aid" : "1234" + } + }, { + "roles" : [ { + "roleId" : "35", + "name" : "Organization Admin", + "isBuiltin" : true, + "hasManagementPermissions" : true + }, { + "roleId" : "35", + "name" : "Organization Admin", + "isBuiltin" : true, + "hasManagementPermissions" : true + } ], + "accountGroup" : { + "accountGroupName" : "Account A", + "aid" : "1234" + } + } ], + "name" : "User X", + "email" : "userx@thousandeyes.com", + "dateRegistered" : "2020-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.administrative.models.UserDetail.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + def test_get_user_models_validation(self) -> None: """Test case for get_user request and response models""" diff --git a/thousandeyes-sdk-agents/.openapi-generator/FILES b/thousandeyes-sdk-agents/.openapi-generator/FILES index a627bfbb1..989be4de2 100644 --- a/thousandeyes-sdk-agents/.openapi-generator/FILES +++ b/thousandeyes-sdk-agents/.openapi-generator/FILES @@ -2,17 +2,20 @@ MANIFEST.in README.md docs/AccountGroup.md -docs/Agent.md docs/AgentBase.md docs/AgentClusterAssignRequest.md docs/AgentClusterUnassignRequest.md docs/AgentDetails.md docs/AgentDetailsExpand.md docs/AgentIpv6Policy.md +docs/AgentLabel.md docs/AgentListExpand.md +docs/AgentNotification.md docs/AgentProxies.md +docs/AgentProxiesApi.md docs/AgentProxy.md docs/AgentRequest.md +docs/AgentResponse.md docs/AlertEmail.md docs/AlertIntegrationBase.md docs/AlertIntegrationType.md @@ -35,14 +38,11 @@ docs/Error.md docs/ErrorDetail.md docs/ErrorDetailCode.md docs/InterfaceIpMapping.md -docs/Labels.md docs/Link.md docs/ListNotificationRulesResponse.md -docs/Notification.md docs/NotificationRule.md docs/NotificationRuleDetail.md docs/NotificationRules.md -docs/ProxiesApi.md docs/ProxyAuthType.md docs/ProxyType.md docs/SelfLinks.md @@ -60,23 +60,25 @@ pyproject.toml setup.cfg src/thousandeyes_sdk/agents/__init__.py src/thousandeyes_sdk/agents/api/__init__.py +src/thousandeyes_sdk/agents/api/agent_proxies_api.py src/thousandeyes_sdk/agents/api/cloud_and_enterprise_agent_notification_rules_api.py src/thousandeyes_sdk/agents/api/cloud_and_enterprise_agents_api.py src/thousandeyes_sdk/agents/api/enterprise_agent_cluster_api.py -src/thousandeyes_sdk/agents/api/proxies_api.py src/thousandeyes_sdk/agents/models/__init__.py src/thousandeyes_sdk/agents/models/account_group.py -src/thousandeyes_sdk/agents/models/agent.py src/thousandeyes_sdk/agents/models/agent_base.py src/thousandeyes_sdk/agents/models/agent_cluster_assign_request.py src/thousandeyes_sdk/agents/models/agent_cluster_unassign_request.py src/thousandeyes_sdk/agents/models/agent_details.py src/thousandeyes_sdk/agents/models/agent_details_expand.py src/thousandeyes_sdk/agents/models/agent_ipv6_policy.py +src/thousandeyes_sdk/agents/models/agent_label.py src/thousandeyes_sdk/agents/models/agent_list_expand.py +src/thousandeyes_sdk/agents/models/agent_notification.py src/thousandeyes_sdk/agents/models/agent_proxies.py src/thousandeyes_sdk/agents/models/agent_proxy.py src/thousandeyes_sdk/agents/models/agent_request.py +src/thousandeyes_sdk/agents/models/agent_response.py src/thousandeyes_sdk/agents/models/alert_email.py src/thousandeyes_sdk/agents/models/alert_integration_base.py src/thousandeyes_sdk/agents/models/alert_integration_type.py @@ -96,10 +98,8 @@ src/thousandeyes_sdk/agents/models/error.py src/thousandeyes_sdk/agents/models/error_detail.py src/thousandeyes_sdk/agents/models/error_detail_code.py src/thousandeyes_sdk/agents/models/interface_ip_mapping.py -src/thousandeyes_sdk/agents/models/labels.py src/thousandeyes_sdk/agents/models/link.py src/thousandeyes_sdk/agents/models/list_notification_rules_response.py -src/thousandeyes_sdk/agents/models/notification.py src/thousandeyes_sdk/agents/models/notification_rule.py src/thousandeyes_sdk/agents/models/notification_rule_detail.py src/thousandeyes_sdk/agents/models/notification_rules.py @@ -118,8 +118,8 @@ src/thousandeyes_sdk/agents/models/validation_error.py src/thousandeyes_sdk/agents/models/validation_error_item.py src/thousandeyes_sdk/agents/py.typed test/__init__.py +test/test_agent_proxies_api.py test/test_cloud_and_enterprise_agent_notification_rules_api.py test/test_cloud_and_enterprise_agents_api.py test/test_enterprise_agent_cluster_api.py -test/test_proxies_api.py test/test_utils.py diff --git a/thousandeyes-sdk-agents/README.md b/thousandeyes-sdk-agents/README.md index 18b93a2e5..a9c159a46 100644 --- a/thousandeyes-sdk-agents/README.md +++ b/thousandeyes-sdk-agents/README.md @@ -5,7 +5,7 @@ Manage all agents available to your account in ThousandEyes, including both Clou This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -77,17 +77,16 @@ configuration = thousandeyes_sdk.core.Configuration( # Enter a context with an instance of the API client with thousandeyes_sdk.core.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.agents.CloudAndEnterpriseAgentNotificationRulesApi(api_client) - notification_rule_id = '281474976710706' # str | Unique ID for the agent notification rule. + api_instance = thousandeyes_sdk.agents.AgentProxiesApi(api_client) aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) try: - # Retrieve agent notification rule - api_response = api_instance.get_agents_notification_rule(notification_rule_id, aid=aid) - print("The response of CloudAndEnterpriseAgentNotificationRulesApi->get_agents_notification_rule:\n") + # List agent proxies + api_response = api_instance.get_agents_proxies(aid=aid) + print("The response of AgentProxiesApi->get_agents_proxies:\n") pprint(api_response) except ApiException as e: - print("Exception when calling CloudAndEnterpriseAgentNotificationRulesApi->get_agents_notification_rule: %s\n" % e) + print("Exception when calling AgentProxiesApi->get_agents_proxies: %s\n" % e) ``` @@ -97,6 +96,7 @@ All URIs are relative to *https://api.thousandeyes.com/v7* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AgentProxiesApi* | [**get_agents_proxies**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentProxiesApi.md#get_agents_proxies) | **GET** /agents/proxies | List agent proxies *CloudAndEnterpriseAgentNotificationRulesApi* | [**get_agents_notification_rule**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/CloudAndEnterpriseAgentNotificationRulesApi.md#get_agents_notification_rule) | **GET** /agents/notification-rules/{notificationRuleId} | Retrieve agent notification rule *CloudAndEnterpriseAgentNotificationRulesApi* | [**get_agents_notification_rules**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/CloudAndEnterpriseAgentNotificationRulesApi.md#get_agents_notification_rules) | **GET** /agents/notification-rules | List agent notification rules *CloudAndEnterpriseAgentsApi* | [**delete_agent**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/CloudAndEnterpriseAgentsApi.md#delete_agent) | **DELETE** /agents/{agentId} | Delete Enterprise Agent @@ -105,23 +105,24 @@ Class | Method | HTTP request | Description *CloudAndEnterpriseAgentsApi* | [**update_agent**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/CloudAndEnterpriseAgentsApi.md#update_agent) | **PUT** /agents/{agentId} | Update Enterprise Agent *EnterpriseAgentClusterApi* | [**assign_agent_to_cluster**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/EnterpriseAgentClusterApi.md#assign_agent_to_cluster) | **POST** /agents/{agentId}/cluster/assign | Add member to Enterprise Agent cluster *EnterpriseAgentClusterApi* | [**unassign_agent_from_cluster**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/EnterpriseAgentClusterApi.md#unassign_agent_from_cluster) | **POST** /agents/{agentId}/cluster/unassign | Remove member from Enterprise Agent cluster -*ProxiesApi* | [**get_agents_proxies**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/ProxiesApi.md#get_agents_proxies) | **GET** /agents/proxies | List agent proxies ## Documentation For Models - [AccountGroup](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AccountGroup.md) - - [Agent](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/Agent.md) - [AgentBase](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentBase.md) - [AgentClusterAssignRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentClusterAssignRequest.md) - [AgentClusterUnassignRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentClusterUnassignRequest.md) - [AgentDetails](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentDetails.md) - [AgentDetailsExpand](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentDetailsExpand.md) - [AgentIpv6Policy](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentIpv6Policy.md) + - [AgentLabel](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentLabel.md) - [AgentListExpand](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentListExpand.md) + - [AgentNotification](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentNotification.md) - [AgentProxies](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentProxies.md) - [AgentProxy](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentProxy.md) - [AgentRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentRequest.md) + - [AgentResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentResponse.md) - [AlertEmail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AlertEmail.md) - [AlertIntegrationBase](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AlertIntegrationBase.md) - [AlertIntegrationType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AlertIntegrationType.md) @@ -141,10 +142,8 @@ Class | Method | HTTP request | Description - [ErrorDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/ErrorDetail.md) - [ErrorDetailCode](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/ErrorDetailCode.md) - [InterfaceIpMapping](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/InterfaceIpMapping.md) - - [Labels](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/Labels.md) - [Link](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/Link.md) - [ListNotificationRulesResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/ListNotificationRulesResponse.md) - - [Notification](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/Notification.md) - [NotificationRule](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/NotificationRule.md) - [NotificationRuleDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/NotificationRuleDetail.md) - [NotificationRules](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/NotificationRules.md) diff --git a/thousandeyes-sdk-agents/docs/AgentDetails.md b/thousandeyes-sdk-agents/docs/AgentDetails.md index a1b3de91a..71bf504e1 100644 --- a/thousandeyes-sdk-agents/docs/AgentDetails.md +++ b/thousandeyes-sdk-agents/docs/AgentDetails.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes **verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly] **agent_type** | **str** | Enterprise Cluster agent type. | **tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] -**labels** | [**List[Labels]**](Labels.md) | List of labels. See `/labels` for more information. | [optional] [readonly] +**labels** | [**List[AgentLabel]**](AgentLabel.md) | List of labels. See `/labels` for more information. | [optional] [readonly] **links** | [**SelfLinks**](SelfLinks.md) | | [optional] **cluster_members** | [**List[ClusterMember]**](ClusterMember.md) | If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents. | [optional] [readonly] **utilization** | **int** | Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only). | [optional] [readonly] diff --git a/thousandeyes-sdk-agents/docs/AgentLabel.md b/thousandeyes-sdk-agents/docs/AgentLabel.md new file mode 100644 index 000000000..264c1f25d --- /dev/null +++ b/thousandeyes-sdk-agents/docs/AgentLabel.md @@ -0,0 +1,30 @@ +# AgentLabel + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label_id** | **str** | Label Id. | [optional] +**name** | **str** | Name of the label. | [optional] + +## Example + +```python +from thousandeyes_sdk.agents.models.agent_label import AgentLabel + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentLabel from a JSON string +agent_label_instance = AgentLabel.from_json(json) +# print the JSON string representation of the object +print(AgentLabel.to_json()) + +# convert the object into a dict +agent_label_dict = agent_label_instance.to_dict() +# create an instance of AgentLabel from a dict +agent_label_from_dict = AgentLabel.from_dict(agent_label_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-agents/docs/AgentNotification.md b/thousandeyes-sdk-agents/docs/AgentNotification.md new file mode 100644 index 000000000..3aae6da03 --- /dev/null +++ b/thousandeyes-sdk-agents/docs/AgentNotification.md @@ -0,0 +1,32 @@ +# AgentNotification + +Alert notification object. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | [**AlertEmail**](AlertEmail.md) | | [optional] +**third_party** | [**List[AlertIntegrationBase]**](AlertIntegrationBase.md) | | [optional] +**webhook** | [**List[AlertIntegrationBase]**](AlertIntegrationBase.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.agents.models.agent_notification import AgentNotification + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentNotification from a JSON string +agent_notification_instance = AgentNotification.from_json(json) +# print the JSON string representation of the object +print(AgentNotification.to_json()) + +# convert the object into a dict +agent_notification_dict = agent_notification_instance.to_dict() +# create an instance of AgentNotification from a dict +agent_notification_from_dict = AgentNotification.from_dict(agent_notification_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-agents/docs/AgentProxiesApi.md b/thousandeyes-sdk-agents/docs/AgentProxiesApi.md new file mode 100644 index 000000000..1bebc80fb --- /dev/null +++ b/thousandeyes-sdk-agents/docs/AgentProxiesApi.md @@ -0,0 +1,94 @@ +# thousandeyes_sdk.agents.AgentProxiesApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_agents_proxies**](AgentProxiesApi.md#get_agents_proxies) | **GET** /agents/proxies | List agent proxies + + +# **get_agents_proxies** +> AgentProxies get_agents_proxies(aid=aid) + +List agent proxies + +List all agent proxies available under the account group. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.agents +from thousandeyes_sdk.agents.models.agent_proxies import AgentProxies +from thousandeyes_sdk.agents.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.agents.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.agents.AgentProxiesApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List agent proxies + api_response = api_instance.get_agents_proxies(aid=aid) + print("The response of AgentProxiesApi->get_agents_proxies:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentProxiesApi->get_agents_proxies: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**AgentProxies**](AgentProxies.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-agents/docs/AgentResponse.md b/thousandeyes-sdk-agents/docs/AgentResponse.md new file mode 100644 index 000000000..79b6d5371 --- /dev/null +++ b/thousandeyes-sdk-agents/docs/AgentResponse.md @@ -0,0 +1,39 @@ +# AgentResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly] +**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly] +**network** | **str** | Network (including ASN) of agent’s public IP. | [optional] [readonly] +**agent_id** | **str** | Unique ID of the agent. | [optional] [readonly] +**agent_name** | **str** | Name of the agent. | [optional] +**location** | **str** | Location of the agent. | [optional] [readonly] +**country_id** | **str** | 2-digit ISO country code | [optional] [readonly] +**enabled** | **bool** | Flag indicating if the agent is enabled. | [optional] +**prefix** | **str** | Prefix containing agents public IP address. | [optional] [readonly] +**verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly] +**agent_type** | [**CloudEnterpriseAgentType**](CloudEnterpriseAgentType.md) | | + +## Example + +```python +from thousandeyes_sdk.agents.models.agent_response import AgentResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentResponse from a JSON string +agent_response_instance = AgentResponse.from_json(json) +# print the JSON string representation of the object +print(AgentResponse.to_json()) + +# convert the object into a dict +agent_response_dict = agent_response_instance.to_dict() +# create an instance of AgentResponse from a dict +agent_response_from_dict = AgentResponse.from_dict(agent_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-agents/docs/CloudAgentDetail.md b/thousandeyes-sdk-agents/docs/CloudAgentDetail.md index 3e30c382b..8bc2b6684 100644 --- a/thousandeyes-sdk-agents/docs/CloudAgentDetail.md +++ b/thousandeyes-sdk-agents/docs/CloudAgentDetail.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes **verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly] **agent_type** | **str** | Cloud agent type. | **tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] -**labels** | [**List[Labels]**](Labels.md) | List of labels - see `/labels` for more information. | [optional] [readonly] +**labels** | [**List[AgentLabel]**](AgentLabel.md) | List of labels - see `/labels` for more information. | [optional] [readonly] **links** | [**SelfLinks**](SelfLinks.md) | | [optional] ## Example diff --git a/thousandeyes-sdk-agents/docs/EnterpriseAgentClusterDetail.md b/thousandeyes-sdk-agents/docs/EnterpriseAgentClusterDetail.md index 062462874..cc080fb0e 100644 --- a/thousandeyes-sdk-agents/docs/EnterpriseAgentClusterDetail.md +++ b/thousandeyes-sdk-agents/docs/EnterpriseAgentClusterDetail.md @@ -30,7 +30,7 @@ Name | Type | Description | Notes **interface_ip_mappings** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] **tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] **notification_rules** | [**List[NotificationRules]**](NotificationRules.md) | List of notification rule objects configured on agent | [optional] -**labels** | [**List[Labels]**](Labels.md) | List of labels. See `/labels` for more information. | [optional] [readonly] +**labels** | [**List[AgentLabel]**](AgentLabel.md) | List of labels. See `/labels` for more information. | [optional] [readonly] **agent_type** | **str** | Enterprise Cluster agent type. | **links** | [**SelfLinks**](SelfLinks.md) | | [optional] diff --git a/thousandeyes-sdk-agents/docs/EnterpriseAgentDetail.md b/thousandeyes-sdk-agents/docs/EnterpriseAgentDetail.md index 16c52e73e..2b5c40a48 100644 --- a/thousandeyes-sdk-agents/docs/EnterpriseAgentDetail.md +++ b/thousandeyes-sdk-agents/docs/EnterpriseAgentDetail.md @@ -30,7 +30,7 @@ Name | Type | Description | Notes **interface_ip_mappings** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] **tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] **notification_rules** | [**List[NotificationRules]**](NotificationRules.md) | List of notification rule objects configured on agent | [optional] -**labels** | [**List[Labels]**](Labels.md) | List of labels. See `/labels` for more information. | [optional] [readonly] +**labels** | [**List[AgentLabel]**](AgentLabel.md) | List of labels. See `/labels` for more information. | [optional] [readonly] **agent_type** | **str** | Enterprise agent type. | **links** | [**SelfLinks**](SelfLinks.md) | | [optional] diff --git a/thousandeyes-sdk-agents/docs/EnterpriseAgentResponseExpands.md b/thousandeyes-sdk-agents/docs/EnterpriseAgentResponseExpands.md index 8f9807afc..9467582f3 100644 --- a/thousandeyes-sdk-agents/docs/EnterpriseAgentResponseExpands.md +++ b/thousandeyes-sdk-agents/docs/EnterpriseAgentResponseExpands.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] **notification_rules** | [**List[NotificationRules]**](NotificationRules.md) | List of notification rule objects configured on agent | [optional] -**labels** | [**List[Labels]**](Labels.md) | List of labels. See `/labels` for more information. | [optional] [readonly] +**labels** | [**List[AgentLabel]**](AgentLabel.md) | List of labels. See `/labels` for more information. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-agents/docs/NotificationRuleDetail.md b/thousandeyes-sdk-agents/docs/NotificationRuleDetail.md index f99d7aa7a..9fd94e473 100644 --- a/thousandeyes-sdk-agents/docs/NotificationRuleDetail.md +++ b/thousandeyes-sdk-agents/docs/NotificationRuleDetail.md @@ -10,8 +10,8 @@ Name | Type | Description | Notes **expression** | **str** | Expression of agent notification rule | [optional] **notify_on_clear** | **bool** | Send notification when notification clears | [optional] **is_default** | **bool** | Agent notification rule will be automatically included on all new Enterprise Agents. | [optional] -**notifications** | [**Notification**](Notification.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | | [optional] +**notifications** | [**AgentNotification**](AgentNotification.md) | | [optional] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | | [optional] **links** | [**SelfLinks**](SelfLinks.md) | | [optional] ## Example diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/__init__.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/__init__.py index e4e6d30a1..63c64bc65 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/__init__.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/__init__.py @@ -14,25 +14,27 @@ # import apis into sdk package +from thousandeyes_sdk.agents.api.agent_proxies_api import AgentProxiesApi from thousandeyes_sdk.agents.api.cloud_and_enterprise_agent_notification_rules_api import CloudAndEnterpriseAgentNotificationRulesApi from thousandeyes_sdk.agents.api.cloud_and_enterprise_agents_api import CloudAndEnterpriseAgentsApi from thousandeyes_sdk.agents.api.enterprise_agent_cluster_api import EnterpriseAgentClusterApi -from thousandeyes_sdk.agents.api.proxies_api import ProxiesApi # import models into sdk package from thousandeyes_sdk.agents.models.account_group import AccountGroup -from thousandeyes_sdk.agents.models.agent import Agent from thousandeyes_sdk.agents.models.agent_base import AgentBase from thousandeyes_sdk.agents.models.agent_cluster_assign_request import AgentClusterAssignRequest from thousandeyes_sdk.agents.models.agent_cluster_unassign_request import AgentClusterUnassignRequest from thousandeyes_sdk.agents.models.agent_details import AgentDetails from thousandeyes_sdk.agents.models.agent_details_expand import AgentDetailsExpand from thousandeyes_sdk.agents.models.agent_ipv6_policy import AgentIpv6Policy +from thousandeyes_sdk.agents.models.agent_label import AgentLabel from thousandeyes_sdk.agents.models.agent_list_expand import AgentListExpand +from thousandeyes_sdk.agents.models.agent_notification import AgentNotification from thousandeyes_sdk.agents.models.agent_proxies import AgentProxies from thousandeyes_sdk.agents.models.agent_proxy import AgentProxy from thousandeyes_sdk.agents.models.agent_request import AgentRequest +from thousandeyes_sdk.agents.models.agent_response import AgentResponse from thousandeyes_sdk.agents.models.alert_email import AlertEmail from thousandeyes_sdk.agents.models.alert_integration_base import AlertIntegrationBase from thousandeyes_sdk.agents.models.alert_integration_type import AlertIntegrationType @@ -52,10 +54,8 @@ from thousandeyes_sdk.agents.models.error_detail import ErrorDetail from thousandeyes_sdk.agents.models.error_detail_code import ErrorDetailCode from thousandeyes_sdk.agents.models.interface_ip_mapping import InterfaceIpMapping -from thousandeyes_sdk.agents.models.labels import Labels from thousandeyes_sdk.agents.models.link import Link from thousandeyes_sdk.agents.models.list_notification_rules_response import ListNotificationRulesResponse -from thousandeyes_sdk.agents.models.notification import Notification from thousandeyes_sdk.agents.models.notification_rule import NotificationRule from thousandeyes_sdk.agents.models.notification_rule_detail import NotificationRuleDetail from thousandeyes_sdk.agents.models.notification_rules import NotificationRules diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/__init__.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/__init__.py index 498b08f35..84b34086f 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/__init__.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/__init__.py @@ -1,8 +1,8 @@ # flake8: noqa # import apis into api package +from thousandeyes_sdk.agents.api.agent_proxies_api import AgentProxiesApi from thousandeyes_sdk.agents.api.cloud_and_enterprise_agent_notification_rules_api import CloudAndEnterpriseAgentNotificationRulesApi from thousandeyes_sdk.agents.api.cloud_and_enterprise_agents_api import CloudAndEnterpriseAgentsApi from thousandeyes_sdk.agents.api.enterprise_agent_cluster_api import EnterpriseAgentClusterApi -from thousandeyes_sdk.agents.api.proxies_api import ProxiesApi diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/agent_proxies_api.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/agent_proxies_api.py new file mode 100644 index 000000000..5fb11166d --- /dev/null +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/agent_proxies_api.py @@ -0,0 +1,324 @@ +# coding: utf-8 + +""" + Agents API + + ## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.agents.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.agents.models.agent_proxies import AgentProxies + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class AgentProxiesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-agents")) + self.api_client = api_client + + + @validate_call + def get_agents_proxies( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AgentProxies: + """List agent proxies + + List all agent proxies available under the account group. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agents_proxies_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentProxies", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.agents.models, + ).data + + + @validate_call + def get_agents_proxies_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AgentProxies]: + """List agent proxies + + List all agent proxies available under the account group. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agents_proxies_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentProxies", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.agents.models, + ) + + + @validate_call + def get_agents_proxies_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List agent proxies + + List all agent proxies available under the account group. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agents_proxies_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentProxies", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agents_proxies_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/agents/proxies', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/__init__.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/__init__.py index 1abe8b1eb..24c04aa6a 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/__init__.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/__init__.py @@ -14,17 +14,19 @@ # import models into model package from thousandeyes_sdk.agents.models.account_group import AccountGroup -from thousandeyes_sdk.agents.models.agent import Agent from thousandeyes_sdk.agents.models.agent_base import AgentBase from thousandeyes_sdk.agents.models.agent_cluster_assign_request import AgentClusterAssignRequest from thousandeyes_sdk.agents.models.agent_cluster_unassign_request import AgentClusterUnassignRequest from thousandeyes_sdk.agents.models.agent_details import AgentDetails from thousandeyes_sdk.agents.models.agent_details_expand import AgentDetailsExpand from thousandeyes_sdk.agents.models.agent_ipv6_policy import AgentIpv6Policy +from thousandeyes_sdk.agents.models.agent_label import AgentLabel from thousandeyes_sdk.agents.models.agent_list_expand import AgentListExpand +from thousandeyes_sdk.agents.models.agent_notification import AgentNotification from thousandeyes_sdk.agents.models.agent_proxies import AgentProxies from thousandeyes_sdk.agents.models.agent_proxy import AgentProxy from thousandeyes_sdk.agents.models.agent_request import AgentRequest +from thousandeyes_sdk.agents.models.agent_response import AgentResponse from thousandeyes_sdk.agents.models.alert_email import AlertEmail from thousandeyes_sdk.agents.models.alert_integration_base import AlertIntegrationBase from thousandeyes_sdk.agents.models.alert_integration_type import AlertIntegrationType @@ -44,10 +46,8 @@ from thousandeyes_sdk.agents.models.error_detail import ErrorDetail from thousandeyes_sdk.agents.models.error_detail_code import ErrorDetailCode from thousandeyes_sdk.agents.models.interface_ip_mapping import InterfaceIpMapping -from thousandeyes_sdk.agents.models.labels import Labels from thousandeyes_sdk.agents.models.link import Link from thousandeyes_sdk.agents.models.list_notification_rules_response import ListNotificationRulesResponse -from thousandeyes_sdk.agents.models.notification import Notification from thousandeyes_sdk.agents.models.notification_rule import NotificationRule from thousandeyes_sdk.agents.models.notification_rule_detail import NotificationRuleDetail from thousandeyes_sdk.agents.models.notification_rules import NotificationRules diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_label.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_label.py new file mode 100644 index 000000000..ae16b07b2 --- /dev/null +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_label.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Agents API + + ## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AgentLabel(BaseModel): + """ + AgentLabel + """ # noqa: E501 + label_id: Optional[StrictStr] = Field(default=None, description="Label Id.", alias="labelId") + name: Optional[StrictStr] = Field(default=None, description="Name of the label.") + __properties: ClassVar[List[str]] = ["labelId", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentLabel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentLabel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "labelId": obj.get("labelId"), + "name": obj.get("name") + }) + return _obj + + diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_notification.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_notification.py new file mode 100644 index 000000000..494128c9b --- /dev/null +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_notification.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Agents API + + ## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.agents.models.alert_email import AlertEmail +from thousandeyes_sdk.agents.models.alert_integration_base import AlertIntegrationBase +from typing import Optional, Set +from typing_extensions import Self + +class AgentNotification(BaseModel): + """ + Alert notification object. + """ # noqa: E501 + email: Optional[AlertEmail] = None + third_party: Optional[List[AlertIntegrationBase]] = Field(default=None, alias="thirdParty") + webhook: Optional[List[AlertIntegrationBase]] = None + __properties: ClassVar[List[str]] = ["email", "thirdParty", "webhook"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentNotification from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of email + if self.email: + _dict['email'] = self.email.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in third_party (list) + _items = [] + if self.third_party: + for _item in self.third_party: + if _item: + _items.append(_item.to_dict()) + _dict['thirdParty'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in webhook (list) + _items = [] + if self.webhook: + for _item in self.webhook: + if _item: + _items.append(_item.to_dict()) + _dict['webhook'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentNotification from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": AlertEmail.from_dict(obj["email"]) if obj.get("email") is not None else None, + "thirdParty": [AlertIntegrationBase.from_dict(_item) for _item in obj["thirdParty"]] if obj.get("thirdParty") is not None else None, + "webhook": [AlertIntegrationBase.from_dict(_item) for _item in obj["webhook"]] if obj.get("webhook") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_response.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_response.py new file mode 100644 index 000000000..247f49f1e --- /dev/null +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Agents API + + ## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.agents.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from typing import Optional, Set +from typing_extensions import Self + +class AgentResponse(BaseModel): + """ + AgentResponse + """ # noqa: E501 + ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses") + public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses") + network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agent’s public IP.") + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the agent.", alias="agentId") + agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent.", alias="agentName") + location: Optional[StrictStr] = Field(default=None, description="Location of the agent.") + country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code", alias="countryId") + enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.") + prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.") + verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates") + agent_type: CloudEnterpriseAgentType = Field(alias="agentType") + __properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "agentType"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "ip_addresses", + "public_ip_addresses", + "network", + "agent_id", + "location", + "country_id", + "prefix", + "verify_ssl_certificates", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ipAddresses": obj.get("ipAddresses"), + "publicIpAddresses": obj.get("publicIpAddresses"), + "network": obj.get("network"), + "agentId": obj.get("agentId"), + "agentName": obj.get("agentName"), + "location": obj.get("location"), + "countryId": obj.get("countryId"), + "enabled": obj.get("enabled"), + "prefix": obj.get("prefix"), + "verifySslCertificates": obj.get("verifySslCertificates"), + "agentType": obj.get("agentType") + }) + return _obj + + diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/cloud_agent_detail.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/cloud_agent_detail.py index 1aa2442b1..cb6c9cc20 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/cloud_agent_detail.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/cloud_agent_detail.py @@ -19,7 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.agents.models.labels import Labels +from thousandeyes_sdk.agents.models.agent_label import AgentLabel from thousandeyes_sdk.agents.models.self_links import SelfLinks from thousandeyes_sdk.agents.models.simple_test import SimpleTest from typing import Optional, Set @@ -41,7 +41,7 @@ class CloudAgentDetail(BaseModel): verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates") agent_type: Annotated[str, Field(strict=True)] = Field(description="Cloud agent type.", alias="agentType") tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.") - labels: Optional[List[Labels]] = Field(default=None, description="List of labels - see `/labels` for more information.") + labels: Optional[List[AgentLabel]] = Field(default=None, description="List of labels - see `/labels` for more information.") links: Optional[SelfLinks] = Field(default=None, alias="_links") __properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "agentType", "tests", "labels", "_links"] @@ -151,7 +151,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "verifySslCertificates": obj.get("verifySslCertificates"), "agentType": obj.get("agentType"), "tests": [SimpleTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None, - "labels": [Labels.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "labels": [AgentLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None }) return _obj diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/cloud_enterprise_agent.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/cloud_enterprise_agent.py index 005bb8082..385e29348 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/cloud_enterprise_agent.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/cloud_enterprise_agent.py @@ -18,28 +18,28 @@ import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Optional -from thousandeyes_sdk.agents.models.agent import Agent +from thousandeyes_sdk.agents.models.agent_response import AgentResponse from thousandeyes_sdk.agents.models.enterprise_agent import EnterpriseAgent from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict from typing_extensions import Literal, Self from pydantic import Field, model_serializer -CLOUDENTERPRISEAGENT_ANY_OF_SCHEMAS = ["Agent", "EnterpriseAgent"] +CLOUDENTERPRISEAGENT_ANY_OF_SCHEMAS = ["AgentResponse", "EnterpriseAgent"] class CloudEnterpriseAgent(BaseModel): """ CloudEnterpriseAgent """ - # data type: Agent - anyof_schema_1_validator: Optional[Agent] = None + # data type: AgentResponse + anyof_schema_1_validator: Optional[AgentResponse] = None # data type: EnterpriseAgent anyof_schema_2_validator: Optional[EnterpriseAgent] = None if TYPE_CHECKING: - actual_instance: Optional[Union[Agent, EnterpriseAgent]] = None + actual_instance: Optional[Union[AgentResponse, EnterpriseAgent]] = None else: actual_instance: Any = None - any_of_schemas: Set[str] = { "Agent", "EnterpriseAgent" } + any_of_schemas: Set[str] = { "AgentResponse", "EnterpriseAgent" } model_config = { "validate_assignment": True, @@ -60,9 +60,9 @@ def __init__(self, *args, **kwargs) -> None: def actual_instance_must_validate_anyof(cls, v): instance = CloudEnterpriseAgent.model_construct() error_messages = [] - # validate data type: Agent - if not isinstance(v, Agent): - error_messages.append(f"Error! Input type `{type(v)}` is not `Agent`") + # validate data type: AgentResponse + if not isinstance(v, AgentResponse): + error_messages.append(f"Error! Input type `{type(v)}` is not `AgentResponse`") else: return v @@ -74,7 +74,7 @@ def actual_instance_must_validate_anyof(cls, v): if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in CloudEnterpriseAgent with anyOf schemas: Agent, EnterpriseAgent. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in CloudEnterpriseAgent with anyOf schemas: AgentResponse, EnterpriseAgent. Details: " + ", ".join(error_messages)) else: return v @@ -87,9 +87,9 @@ def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" instance = cls.model_construct() error_messages = [] - # anyof_schema_1_validator: Optional[Agent] = None + # anyof_schema_1_validator: Optional[AgentResponse] = None try: - instance.actual_instance = Agent.from_json(json_str) + instance.actual_instance = AgentResponse.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) @@ -102,7 +102,7 @@ def from_json(cls, json_str: str) -> Self: if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into CloudEnterpriseAgent with anyOf schemas: Agent, EnterpriseAgent. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into CloudEnterpriseAgent with anyOf schemas: AgentResponse, EnterpriseAgent. Details: " + ", ".join(error_messages)) else: return instance @@ -120,7 +120,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], Agent, EnterpriseAgent]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], AgentResponse, EnterpriseAgent]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_cluster_detail.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_cluster_detail.py index c843ac52f..98fb6c951 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_cluster_detail.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_cluster_detail.py @@ -21,12 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from thousandeyes_sdk.agents.models.account_group import AccountGroup +from thousandeyes_sdk.agents.models.agent_label import AgentLabel from thousandeyes_sdk.agents.models.cluster_member import ClusterMember from thousandeyes_sdk.agents.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy from thousandeyes_sdk.agents.models.enterprise_agent_state import EnterpriseAgentState from thousandeyes_sdk.agents.models.error_detail import ErrorDetail from thousandeyes_sdk.agents.models.interface_ip_mapping import InterfaceIpMapping -from thousandeyes_sdk.agents.models.labels import Labels from thousandeyes_sdk.agents.models.notification_rules import NotificationRules from thousandeyes_sdk.agents.models.self_links import SelfLinks from thousandeyes_sdk.agents.models.simple_test import SimpleTest @@ -62,7 +62,7 @@ class EnterpriseAgentClusterDetail(BaseModel): interface_ip_mappings: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMappings") tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.") notification_rules: Optional[List[NotificationRules]] = Field(default=None, description="List of notification rule objects configured on agent", alias="notificationRules") - labels: Optional[List[Labels]] = Field(default=None, description="List of labels. See `/labels` for more information.") + labels: Optional[List[AgentLabel]] = Field(default=None, description="List of labels. See `/labels` for more information.") agent_type: Annotated[str, Field(strict=True)] = Field(description="Enterprise Cluster agent type.", alias="agentType") links: Optional[SelfLinks] = Field(default=None, alias="_links") __properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMappings", "tests", "notificationRules", "labels", "agentType", "_links"] @@ -235,7 +235,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "interfaceIpMappings": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMappings"]] if obj.get("interfaceIpMappings") is not None else None, "tests": [SimpleTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None, "notificationRules": [NotificationRules.from_dict(_item) for _item in obj["notificationRules"]] if obj.get("notificationRules") is not None else None, - "labels": [Labels.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "labels": [AgentLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, "agentType": obj.get("agentType"), "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None }) diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_detail.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_detail.py index b2c0bdfaf..c92286dfb 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_detail.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_detail.py @@ -21,12 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from thousandeyes_sdk.agents.models.account_group import AccountGroup +from thousandeyes_sdk.agents.models.agent_label import AgentLabel from thousandeyes_sdk.agents.models.cluster_member import ClusterMember from thousandeyes_sdk.agents.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy from thousandeyes_sdk.agents.models.enterprise_agent_state import EnterpriseAgentState from thousandeyes_sdk.agents.models.error_detail import ErrorDetail from thousandeyes_sdk.agents.models.interface_ip_mapping import InterfaceIpMapping -from thousandeyes_sdk.agents.models.labels import Labels from thousandeyes_sdk.agents.models.notification_rules import NotificationRules from thousandeyes_sdk.agents.models.self_links import SelfLinks from thousandeyes_sdk.agents.models.simple_test import SimpleTest @@ -62,7 +62,7 @@ class EnterpriseAgentDetail(BaseModel): interface_ip_mappings: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMappings") tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.") notification_rules: Optional[List[NotificationRules]] = Field(default=None, description="List of notification rule objects configured on agent", alias="notificationRules") - labels: Optional[List[Labels]] = Field(default=None, description="List of labels. See `/labels` for more information.") + labels: Optional[List[AgentLabel]] = Field(default=None, description="List of labels. See `/labels` for more information.") agent_type: Annotated[str, Field(strict=True)] = Field(description="Enterprise agent type.", alias="agentType") links: Optional[SelfLinks] = Field(default=None, alias="_links") __properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMappings", "tests", "notificationRules", "labels", "agentType", "_links"] @@ -235,7 +235,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "interfaceIpMappings": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMappings"]] if obj.get("interfaceIpMappings") is not None else None, "tests": [SimpleTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None, "notificationRules": [NotificationRules.from_dict(_item) for _item in obj["notificationRules"]] if obj.get("notificationRules") is not None else None, - "labels": [Labels.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "labels": [AgentLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, "agentType": obj.get("agentType"), "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None }) diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_response_expands.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_response_expands.py index 6647c0aab..b75d26bf8 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_response_expands.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_response_expands.py @@ -18,7 +18,7 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.agents.models.labels import Labels +from thousandeyes_sdk.agents.models.agent_label import AgentLabel from thousandeyes_sdk.agents.models.notification_rules import NotificationRules from thousandeyes_sdk.agents.models.simple_test import SimpleTest from typing import Optional, Set @@ -30,7 +30,7 @@ class EnterpriseAgentResponseExpands(BaseModel): """ # noqa: E501 tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.") notification_rules: Optional[List[NotificationRules]] = Field(default=None, description="List of notification rule objects configured on agent", alias="notificationRules") - labels: Optional[List[Labels]] = Field(default=None, description="List of labels. See `/labels` for more information.") + labels: Optional[List[AgentLabel]] = Field(default=None, description="List of labels. See `/labels` for more information.") __properties: ClassVar[List[str]] = ["tests", "notificationRules", "labels"] model_config = ConfigDict( @@ -110,7 +110,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "tests": [SimpleTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None, "notificationRules": [NotificationRules.from_dict(_item) for _item in obj["notificationRules"]] if obj.get("notificationRules") is not None else None, - "labels": [Labels.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None + "labels": [AgentLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None }) return _obj diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/notification_rule_detail.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/notification_rule_detail.py index cadfe5813..db76437ce 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/notification_rule_detail.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/notification_rule_detail.py @@ -18,8 +18,8 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.agents.models.agent import Agent -from thousandeyes_sdk.agents.models.notification import Notification +from thousandeyes_sdk.agents.models.agent_notification import AgentNotification +from thousandeyes_sdk.agents.models.agent_response import AgentResponse from thousandeyes_sdk.agents.models.self_links import SelfLinks from typing import Optional, Set from typing_extensions import Self @@ -33,8 +33,8 @@ class NotificationRuleDetail(BaseModel): expression: Optional[StrictStr] = Field(default=None, description="Expression of agent notification rule") notify_on_clear: Optional[StrictBool] = Field(default=None, description="Send notification when notification clears", alias="notifyOnClear") is_default: Optional[StrictBool] = Field(default=None, description="Agent notification rule will be automatically included on all new Enterprise Agents.", alias="isDefault") - notifications: Optional[Notification] = None - agents: Optional[List[Agent]] = None + notifications: Optional[AgentNotification] = None + agents: Optional[List[AgentResponse]] = None links: Optional[SelfLinks] = Field(default=None, alias="_links") __properties: ClassVar[List[str]] = ["ruleId", "ruleName", "expression", "notifyOnClear", "isDefault", "notifications", "agents", "_links"] @@ -110,8 +110,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "expression": obj.get("expression"), "notifyOnClear": obj.get("notifyOnClear"), "isDefault": obj.get("isDefault"), - "notifications": Notification.from_dict(obj["notifications"]) if obj.get("notifications") is not None else None, - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, + "notifications": AgentNotification.from_dict(obj["notifications"]) if obj.get("notifications") is not None else None, + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None }) return _obj diff --git a/thousandeyes-sdk-agents/test/test_agent_proxies_api.py b/thousandeyes-sdk-agents/test/test_agent_proxies_api.py new file mode 100644 index 000000000..c8b51d116 --- /dev/null +++ b/thousandeyes-sdk-agents/test/test_agent_proxies_api.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + Agents API + + ## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.agents.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.agents.api.agent_proxies_api import AgentProxiesApi + + +class TestAgentProxiesApi(unittest.TestCase): + """AgentProxiesApi unit test stubs""" + + def setUp(self) -> None: + self.api = AgentProxiesApi() + + def tearDown(self) -> None: + pass + + def test_get_agents_proxies_models_validation(self) -> None: + """Test case for get_agents_proxies request and response models""" + + response_body_json = """ + { + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "agentProxies" : [ { + "password" : "**********", + "isLocalConfigured" : true, + "name" : "Test Proxy - Auth Type - BASIC", + "location" : "proxy.thousandeyes.com:3128", + "lastModified" : "2022-07-17T22:00:54Z", + "authType" : "basic", + "type" : "static", + "aid" : "1234", + "bypassList" : [ "10.0.0.0/16", "*.thousandeyes.com" ], + "user" : "user1", + "proxyId" : "281474976710706" + }, { + "password" : "**********", + "isLocalConfigured" : true, + "name" : "Test Proxy - Auth Type - BASIC", + "location" : "proxy.thousandeyes.com:3128", + "lastModified" : "2022-07-17T22:00:54Z", + "authType" : "basic", + "type" : "static", + "aid" : "1234", + "bypassList" : [ "10.0.0.0/16", "*.thousandeyes.com" ], + "user" : "user1", + "proxyId" : "281474976710706" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.agents.models.AgentProxies.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-agents/test/test_cloud_and_enterprise_agents_api.py b/thousandeyes-sdk-agents/test/test_cloud_and_enterprise_agents_api.py index c8f664f8a..f2df9cfcb 100644 --- a/thousandeyes-sdk-agents/test/test_cloud_and_enterprise_agents_api.py +++ b/thousandeyes-sdk-agents/test/test_cloud_and_enterprise_agents_api.py @@ -89,7 +89,7 @@ def test_get_agent_models_validation(self) -> None: "createdDate" : "2022-07-17T22:00:54Z", "createdBy" : "user@user.com", "modifiedDate" : "2022-07-17T22:00:54Z", - "interval" : 120, + "interval" : 60, "modifiedBy" : "user@user.com", "testId" : "281474976710706", "alertsEnabled" : true, @@ -120,7 +120,7 @@ def test_get_agent_models_validation(self) -> None: "createdDate" : "2022-07-17T22:00:54Z", "createdBy" : "user@user.com", "modifiedDate" : "2022-07-17T22:00:54Z", - "interval" : 120, + "interval" : 60, "modifiedBy" : "user@user.com", "testId" : "281474976710706", "alertsEnabled" : true, @@ -256,7 +256,7 @@ def test_update_agent_models_validation(self) -> None: "createdDate" : "2022-07-17T22:00:54Z", "createdBy" : "user@user.com", "modifiedDate" : "2022-07-17T22:00:54Z", - "interval" : 120, + "interval" : 60, "modifiedBy" : "user@user.com", "testId" : "281474976710706", "alertsEnabled" : true, @@ -287,7 +287,7 @@ def test_update_agent_models_validation(self) -> None: "createdDate" : "2022-07-17T22:00:54Z", "createdBy" : "user@user.com", "modifiedDate" : "2022-07-17T22:00:54Z", - "interval" : 120, + "interval" : 60, "modifiedBy" : "user@user.com", "testId" : "281474976710706", "alertsEnabled" : true, diff --git a/thousandeyes-sdk-agents/test/test_enterprise_agent_cluster_api.py b/thousandeyes-sdk-agents/test/test_enterprise_agent_cluster_api.py index e9106c8b7..690d3f854 100644 --- a/thousandeyes-sdk-agents/test/test_enterprise_agent_cluster_api.py +++ b/thousandeyes-sdk-agents/test/test_enterprise_agent_cluster_api.py @@ -93,7 +93,7 @@ def test_assign_agent_to_cluster_models_validation(self) -> None: "createdDate" : "2022-07-17T22:00:54Z", "createdBy" : "user@user.com", "modifiedDate" : "2022-07-17T22:00:54Z", - "interval" : 120, + "interval" : 60, "modifiedBy" : "user@user.com", "testId" : "281474976710706", "alertsEnabled" : true, @@ -124,7 +124,7 @@ def test_assign_agent_to_cluster_models_validation(self) -> None: "createdDate" : "2022-07-17T22:00:54Z", "createdBy" : "user@user.com", "modifiedDate" : "2022-07-17T22:00:54Z", - "interval" : 120, + "interval" : 60, "modifiedBy" : "user@user.com", "testId" : "281474976710706", "alertsEnabled" : true, diff --git a/thousandeyes-sdk-alerts/.openapi-generator/FILES b/thousandeyes-sdk-alerts/.openapi-generator/FILES index edc2b47a4..ae66564ba 100644 --- a/thousandeyes-sdk-alerts/.openapi-generator/FILES +++ b/thousandeyes-sdk-alerts/.openapi-generator/FILES @@ -7,6 +7,7 @@ docs/AlertDirection.md docs/AlertLinks.md docs/AlertMeta.md docs/AlertMetricDetail.md +docs/AlertNotification.md docs/AlertRoundsViolationMode.md docs/AlertRule.md docs/AlertRulesApi.md @@ -29,11 +30,10 @@ docs/EndAlertMetrics.md docs/EndRepeat.md docs/EndRepeatType.md docs/Error.md -docs/Expand.md +docs/ExpandAlertTestOptions.md docs/IntervalType.md docs/LegacyAlert.md docs/Link.md -docs/Notification.md docs/NotificationCustomWebhook.md docs/NotificationEmail.md docs/NotificationThirdParty.md @@ -71,6 +71,7 @@ src/thousandeyes_sdk/alerts/models/alert_direction.py src/thousandeyes_sdk/alerts/models/alert_links.py src/thousandeyes_sdk/alerts/models/alert_meta.py src/thousandeyes_sdk/alerts/models/alert_metric_detail.py +src/thousandeyes_sdk/alerts/models/alert_notification.py src/thousandeyes_sdk/alerts/models/alert_rounds_violation_mode.py src/thousandeyes_sdk/alerts/models/alert_rule.py src/thousandeyes_sdk/alerts/models/alert_suppression_window.py @@ -90,11 +91,10 @@ src/thousandeyes_sdk/alerts/models/end_alert_metrics.py src/thousandeyes_sdk/alerts/models/end_repeat.py src/thousandeyes_sdk/alerts/models/end_repeat_type.py src/thousandeyes_sdk/alerts/models/error.py -src/thousandeyes_sdk/alerts/models/expand.py +src/thousandeyes_sdk/alerts/models/expand_alert_test_options.py src/thousandeyes_sdk/alerts/models/interval_type.py src/thousandeyes_sdk/alerts/models/legacy_alert.py src/thousandeyes_sdk/alerts/models/link.py -src/thousandeyes_sdk/alerts/models/notification.py src/thousandeyes_sdk/alerts/models/notification_custom_webhook.py src/thousandeyes_sdk/alerts/models/notification_email.py src/thousandeyes_sdk/alerts/models/notification_third_party.py diff --git a/thousandeyes-sdk-alerts/README.md b/thousandeyes-sdk-alerts/README.md index c1df5de0a..5dec36758 100644 --- a/thousandeyes-sdk-alerts/README.md +++ b/thousandeyes-sdk-alerts/README.md @@ -12,7 +12,7 @@ For more information about the alerts, see [Alerts](https://docs.thousandeyes.co This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -126,6 +126,7 @@ Class | Method | HTTP request | Description - [AlertLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertLinks.md) - [AlertMeta](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertMeta.md) - [AlertMetricDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertMetricDetail.md) + - [AlertNotification](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertNotification.md) - [AlertRoundsViolationMode](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertRoundsViolationMode.md) - [AlertRule](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertRule.md) - [AlertSuppressionWindow](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertSuppressionWindow.md) @@ -145,11 +146,10 @@ Class | Method | HTTP request | Description - [EndRepeat](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/EndRepeat.md) - [EndRepeatType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/EndRepeatType.md) - [Error](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/Error.md) - - [Expand](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/Expand.md) + - [ExpandAlertTestOptions](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/ExpandAlertTestOptions.md) - [IntervalType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/IntervalType.md) - [LegacyAlert](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/LegacyAlert.md) - [Link](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/Link.md) - - [Notification](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/Notification.md) - [NotificationCustomWebhook](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/NotificationCustomWebhook.md) - [NotificationEmail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/NotificationEmail.md) - [NotificationThirdParty](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/NotificationThirdParty.md) diff --git a/thousandeyes-sdk-alerts/docs/Alert.md b/thousandeyes-sdk-alerts/docs/Alert.md index 99fccb080..f600b3538 100644 --- a/thousandeyes-sdk-alerts/docs/Alert.md +++ b/thousandeyes-sdk-alerts/docs/Alert.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | A unique ID for each individual alert occurrence. | [optional] [readonly] **alert_type** | [**AlertType**](AlertType.md) | | [optional] -**start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) for querying alerts. | [optional] [readonly] -**end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) for querying alerts. | [optional] [readonly] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] **violation_count** | **int** | Number of sources that meet the alert criteria. | [optional] **duration** | **int** | Duration in seconds the alert was active | [optional] **suppressed** | **bool** | Indicates whether the alert is currently suppressed by a real-time ASW. | [optional] diff --git a/thousandeyes-sdk-alerts/docs/AlertDetail.md b/thousandeyes-sdk-alerts/docs/AlertDetail.md index 027a3df61..c9b6e4c9d 100644 --- a/thousandeyes-sdk-alerts/docs/AlertDetail.md +++ b/thousandeyes-sdk-alerts/docs/AlertDetail.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | A unique ID for each individual alert occurrence. | [optional] [readonly] **alert_type** | [**AlertType**](AlertType.md) | | [optional] -**start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) for querying alerts. | [optional] [readonly] -**end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) for querying alerts. | [optional] [readonly] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] **violation_count** | **int** | Number of sources that meet the alert criteria. | [optional] **duration** | **int** | Duration in seconds the alert was active | [optional] **suppressed** | **bool** | Indicates whether the alert is currently suppressed by a real-time ASW. | [optional] diff --git a/thousandeyes-sdk-alerts/docs/AlertNotification.md b/thousandeyes-sdk-alerts/docs/AlertNotification.md new file mode 100644 index 000000000..9c7a98efb --- /dev/null +++ b/thousandeyes-sdk-alerts/docs/AlertNotification.md @@ -0,0 +1,33 @@ +# AlertNotification + +Alert notification object. See Alert notification integrations. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | [**NotificationEmail**](NotificationEmail.md) | | [optional] +**third_party** | [**List[NotificationThirdParty]**](NotificationThirdParty.md) | Third party notifications. | [optional] +**webhook** | [**List[NotificationWebhook]**](NotificationWebhook.md) | Webhook notifications. | [optional] +**custom_webhook** | [**List[NotificationCustomWebhook]**](NotificationCustomWebhook.md) | Custom webhook notifications. | [optional] + +## Example + +```python +from thousandeyes_sdk.alerts.models.alert_notification import AlertNotification + +# TODO update the JSON string below +json = "{}" +# create an instance of AlertNotification from a JSON string +alert_notification_instance = AlertNotification.from_json(json) +# print the JSON string representation of the object +print(AlertNotification.to_json()) + +# convert the object into a dict +alert_notification_dict = alert_notification_instance.to_dict() +# create an instance of AlertNotification from a dict +alert_notification_from_dict = AlertNotification.from_dict(alert_notification_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-alerts/docs/AlertSuppressionWindowsApi.md b/thousandeyes-sdk-alerts/docs/AlertSuppressionWindowsApi.md index 25bec8164..b45482aa3 100644 --- a/thousandeyes-sdk-alerts/docs/AlertSuppressionWindowsApi.md +++ b/thousandeyes-sdk-alerts/docs/AlertSuppressionWindowsApi.md @@ -26,7 +26,7 @@ Creates a new alert suppression window in ThousandEyes, using the provided POST import thousandeyes_sdk.alerts from thousandeyes_sdk.alerts.models.alert_suppression_window_detail import AlertSuppressionWindowDetail from thousandeyes_sdk.alerts.models.alert_suppression_window_request import AlertSuppressionWindowRequest -from thousandeyes_sdk.alerts.models.expand import Expand +from thousandeyes_sdk.alerts.models.expand_alert_test_options import ExpandAlertTestOptions from thousandeyes_sdk.alerts.rest import ApiException from pprint import pprint @@ -52,7 +52,7 @@ with thousandeyes_sdk.alerts.ApiClient(configuration) as api_client: api_instance = thousandeyes_sdk.alerts.AlertSuppressionWindowsApi(api_client) alert_suppression_window_request = thousandeyes_sdk.alerts.AlertSuppressionWindowRequest() # AlertSuppressionWindowRequest | aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) - expand = [thousandeyes_sdk.alerts.Expand()] # List[Expand] | Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. (optional) + expand = [thousandeyes_sdk.alerts.ExpandAlertTestOptions()] # List[ExpandAlertTestOptions] | Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. (optional) try: # Create alert suppression window @@ -72,7 +72,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **alert_suppression_window_request** | [**AlertSuppressionWindowRequest**](AlertSuppressionWindowRequest.md)| | **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] - **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. | [optional] + **expand** | [**List[ExpandAlertTestOptions]**](ExpandAlertTestOptions.md)| Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. | [optional] ### Return type @@ -198,7 +198,7 @@ Returns detailed information about an alert suppression window configured in you ```python import thousandeyes_sdk.alerts from thousandeyes_sdk.alerts.models.alert_suppression_window_detail import AlertSuppressionWindowDetail -from thousandeyes_sdk.alerts.models.expand import Expand +from thousandeyes_sdk.alerts.models.expand_alert_test_options import ExpandAlertTestOptions from thousandeyes_sdk.alerts.rest import ApiException from pprint import pprint @@ -224,7 +224,7 @@ with thousandeyes_sdk.alerts.ApiClient(configuration) as api_client: api_instance = thousandeyes_sdk.alerts.AlertSuppressionWindowsApi(api_client) window_id = '2411' # str | Unique window ID. aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) - expand = [thousandeyes_sdk.alerts.Expand()] # List[Expand] | Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. (optional) + expand = [thousandeyes_sdk.alerts.ExpandAlertTestOptions()] # List[ExpandAlertTestOptions] | Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. (optional) try: # Retrieve alert suppression window @@ -244,7 +244,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **window_id** | **str**| Unique window ID. | **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] - **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. | [optional] + **expand** | [**List[ExpandAlertTestOptions]**](ExpandAlertTestOptions.md)| Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. | [optional] ### Return type @@ -370,7 +370,7 @@ Updates an alert suppression window in ThousandEyes, using the provided POST da import thousandeyes_sdk.alerts from thousandeyes_sdk.alerts.models.alert_suppression_window_detail import AlertSuppressionWindowDetail from thousandeyes_sdk.alerts.models.alert_suppression_window_request import AlertSuppressionWindowRequest -from thousandeyes_sdk.alerts.models.expand import Expand +from thousandeyes_sdk.alerts.models.expand_alert_test_options import ExpandAlertTestOptions from thousandeyes_sdk.alerts.rest import ApiException from pprint import pprint @@ -397,7 +397,7 @@ with thousandeyes_sdk.alerts.ApiClient(configuration) as api_client: window_id = '2411' # str | Unique window ID. alert_suppression_window_request = thousandeyes_sdk.alerts.AlertSuppressionWindowRequest() # AlertSuppressionWindowRequest | aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) - expand = [thousandeyes_sdk.alerts.Expand()] # List[Expand] | Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. (optional) + expand = [thousandeyes_sdk.alerts.ExpandAlertTestOptions()] # List[ExpandAlertTestOptions] | Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. (optional) try: # Update alert suppression window @@ -418,7 +418,7 @@ Name | Type | Description | Notes **window_id** | **str**| Unique window ID. | **alert_suppression_window_request** | [**AlertSuppressionWindowRequest**](AlertSuppressionWindowRequest.md)| | **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] - **expand** | [**List[Expand]**](Expand.md)| Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. | [optional] + **expand** | [**List[ExpandAlertTestOptions]**](ExpandAlertTestOptions.md)| Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. | [optional] ### Return type diff --git a/thousandeyes-sdk-alerts/docs/BaseAlert.md b/thousandeyes-sdk-alerts/docs/BaseAlert.md index 7824c126b..b3c083c4f 100644 --- a/thousandeyes-sdk-alerts/docs/BaseAlert.md +++ b/thousandeyes-sdk-alerts/docs/BaseAlert.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | A unique ID for each individual alert occurrence. | [optional] [readonly] **alert_type** | [**AlertType**](AlertType.md) | | [optional] -**start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) for querying alerts. | [optional] [readonly] -**end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) for querying alerts. | [optional] [readonly] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] **violation_count** | **int** | Number of sources that meet the alert criteria. | [optional] **duration** | **int** | Duration in seconds the alert was active | [optional] **suppressed** | **bool** | Indicates whether the alert is currently suppressed by a real-time ASW. | [optional] diff --git a/thousandeyes-sdk-alerts/docs/ExpandAlertTestOptions.md b/thousandeyes-sdk-alerts/docs/ExpandAlertTestOptions.md new file mode 100644 index 000000000..36ffec38e --- /dev/null +++ b/thousandeyes-sdk-alerts/docs/ExpandAlertTestOptions.md @@ -0,0 +1,11 @@ +# ExpandAlertTestOptions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-alerts/docs/Rule.md b/thousandeyes-sdk-alerts/docs/Rule.md index a250afb4d..1a1044047 100644 --- a/thousandeyes-sdk-alerts/docs/Rule.md +++ b/thousandeyes-sdk-alerts/docs/Rule.md @@ -20,7 +20,7 @@ Name | Type | Description | Notes **include_covered_prefixes** | **bool** | Set true to include covered prefixes in the BGP alert rule. Only applicable to BGP alert rules. | [optional] **sensitivity_level** | [**SensitivityLevel**](SensitivityLevel.md) | | [optional] **severity** | [**Severity**](Severity.md) | | [optional] -**notifications** | [**Notification**](Notification.md) | | [optional] +**notifications** | [**AlertNotification**](AlertNotification.md) | | [optional] **test_ids** | **List[str]** | Array of test IDs to link to alert rule (get `testId` from `/tests` endpoint). | [optional] **links** | [**SelfLinks**](SelfLinks.md) | | [optional] diff --git a/thousandeyes-sdk-alerts/docs/RuleDetail.md b/thousandeyes-sdk-alerts/docs/RuleDetail.md index 48804ff77..3a68f4cd9 100644 --- a/thousandeyes-sdk-alerts/docs/RuleDetail.md +++ b/thousandeyes-sdk-alerts/docs/RuleDetail.md @@ -20,7 +20,7 @@ Name | Type | Description | Notes **include_covered_prefixes** | **bool** | Set true to include covered prefixes in the BGP alert rule. Only applicable to BGP alert rules. | [optional] **sensitivity_level** | [**SensitivityLevel**](SensitivityLevel.md) | | [optional] **severity** | [**Severity**](Severity.md) | | [optional] -**notifications** | [**Notification**](Notification.md) | | [optional] +**notifications** | [**AlertNotification**](AlertNotification.md) | | [optional] **tests** | [**List[BaseTest]**](BaseTest.md) | | [optional] [readonly] **links** | [**SelfLinks**](SelfLinks.md) | | [optional] diff --git a/thousandeyes-sdk-alerts/docs/RuleDetailUpdate.md b/thousandeyes-sdk-alerts/docs/RuleDetailUpdate.md index 9eacea0dc..05f35308a 100644 --- a/thousandeyes-sdk-alerts/docs/RuleDetailUpdate.md +++ b/thousandeyes-sdk-alerts/docs/RuleDetailUpdate.md @@ -20,7 +20,7 @@ Name | Type | Description | Notes **include_covered_prefixes** | **bool** | Set true to include covered prefixes in the BGP alert rule. Only applicable to BGP alert rules. | [optional] **sensitivity_level** | [**SensitivityLevel**](SensitivityLevel.md) | | [optional] **severity** | [**Severity**](Severity.md) | | [optional] -**notifications** | [**Notification**](Notification.md) | | [optional] +**notifications** | [**AlertNotification**](AlertNotification.md) | | [optional] **test_ids** | **List[str]** | Array of test IDs to link to alert rule (get `testId` from `/tests` endpoint). | [optional] ## Example diff --git a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/__init__.py b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/__init__.py index f83742fb0..4ff2fc27e 100644 --- a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/__init__.py +++ b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/__init__.py @@ -26,6 +26,7 @@ from thousandeyes_sdk.alerts.models.alert_links import AlertLinks from thousandeyes_sdk.alerts.models.alert_meta import AlertMeta from thousandeyes_sdk.alerts.models.alert_metric_detail import AlertMetricDetail +from thousandeyes_sdk.alerts.models.alert_notification import AlertNotification from thousandeyes_sdk.alerts.models.alert_rounds_violation_mode import AlertRoundsViolationMode from thousandeyes_sdk.alerts.models.alert_rule import AlertRule from thousandeyes_sdk.alerts.models.alert_suppression_window import AlertSuppressionWindow @@ -45,11 +46,10 @@ from thousandeyes_sdk.alerts.models.end_repeat import EndRepeat from thousandeyes_sdk.alerts.models.end_repeat_type import EndRepeatType from thousandeyes_sdk.alerts.models.error import Error -from thousandeyes_sdk.alerts.models.expand import Expand +from thousandeyes_sdk.alerts.models.expand_alert_test_options import ExpandAlertTestOptions from thousandeyes_sdk.alerts.models.interval_type import IntervalType from thousandeyes_sdk.alerts.models.legacy_alert import LegacyAlert from thousandeyes_sdk.alerts.models.link import Link -from thousandeyes_sdk.alerts.models.notification import Notification from thousandeyes_sdk.alerts.models.notification_custom_webhook import NotificationCustomWebhook from thousandeyes_sdk.alerts.models.notification_email import NotificationEmail from thousandeyes_sdk.alerts.models.notification_third_party import NotificationThirdParty diff --git a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/api/alert_suppression_windows_api.py b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/api/alert_suppression_windows_api.py index 30ae3e696..731b5c063 100644 --- a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/api/alert_suppression_windows_api.py +++ b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/api/alert_suppression_windows_api.py @@ -24,7 +24,7 @@ from thousandeyes_sdk.alerts.models.alert_suppression_window_detail import AlertSuppressionWindowDetail from thousandeyes_sdk.alerts.models.alert_suppression_window_request import AlertSuppressionWindowRequest from thousandeyes_sdk.alerts.models.alert_suppression_windows import AlertSuppressionWindows -from thousandeyes_sdk.alerts.models.expand import Expand +from thousandeyes_sdk.alerts.models.expand_alert_test_options import ExpandAlertTestOptions from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized from thousandeyes_sdk.core.api_response import ApiResponse @@ -50,7 +50,7 @@ def create_alert_suppression_window( self, alert_suppression_window_request: AlertSuppressionWindowRequest, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, + expand: Annotated[Optional[List[ExpandAlertTestOptions]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -73,7 +73,7 @@ def create_alert_suppression_window( :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. - :type expand: List[Expand] + :type expand: List[ExpandAlertTestOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -132,7 +132,7 @@ def create_alert_suppression_window_with_http_info( self, alert_suppression_window_request: AlertSuppressionWindowRequest, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, + expand: Annotated[Optional[List[ExpandAlertTestOptions]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -155,7 +155,7 @@ def create_alert_suppression_window_with_http_info( :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. - :type expand: List[Expand] + :type expand: List[ExpandAlertTestOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -214,7 +214,7 @@ def create_alert_suppression_window_without_preload_content( self, alert_suppression_window_request: AlertSuppressionWindowRequest, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, + expand: Annotated[Optional[List[ExpandAlertTestOptions]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -237,7 +237,7 @@ def create_alert_suppression_window_without_preload_content( :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. - :type expand: List[Expand] + :type expand: List[ExpandAlertTestOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -674,7 +674,7 @@ def get_alert_suppression_window( self, window_id: Annotated[StrictStr, Field(description="Unique window ID.")], aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, + expand: Annotated[Optional[List[ExpandAlertTestOptions]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -697,7 +697,7 @@ def get_alert_suppression_window( :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. - :type expand: List[Expand] + :type expand: List[ExpandAlertTestOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -755,7 +755,7 @@ def get_alert_suppression_window_with_http_info( self, window_id: Annotated[StrictStr, Field(description="Unique window ID.")], aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, + expand: Annotated[Optional[List[ExpandAlertTestOptions]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -778,7 +778,7 @@ def get_alert_suppression_window_with_http_info( :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. - :type expand: List[Expand] + :type expand: List[ExpandAlertTestOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -836,7 +836,7 @@ def get_alert_suppression_window_without_preload_content( self, window_id: Annotated[StrictStr, Field(description="Unique window ID.")], aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, + expand: Annotated[Optional[List[ExpandAlertTestOptions]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -859,7 +859,7 @@ def get_alert_suppression_window_without_preload_content( :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. - :type expand: List[Expand] + :type expand: List[ExpandAlertTestOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1266,7 +1266,7 @@ def update_alert_suppression_window( window_id: Annotated[StrictStr, Field(description="Unique window ID.")], alert_suppression_window_request: AlertSuppressionWindowRequest, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, + expand: Annotated[Optional[List[ExpandAlertTestOptions]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1291,7 +1291,7 @@ def update_alert_suppression_window( :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. - :type expand: List[Expand] + :type expand: List[ExpandAlertTestOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1352,7 +1352,7 @@ def update_alert_suppression_window_with_http_info( window_id: Annotated[StrictStr, Field(description="Unique window ID.")], alert_suppression_window_request: AlertSuppressionWindowRequest, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, + expand: Annotated[Optional[List[ExpandAlertTestOptions]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1377,7 +1377,7 @@ def update_alert_suppression_window_with_http_info( :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. - :type expand: List[Expand] + :type expand: List[ExpandAlertTestOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1438,7 +1438,7 @@ def update_alert_suppression_window_without_preload_content( window_id: Annotated[StrictStr, Field(description="Unique window ID.")], alert_suppression_window_request: AlertSuppressionWindowRequest, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, + expand: Annotated[Optional[List[ExpandAlertTestOptions]], Field(description="Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1463,7 +1463,7 @@ def update_alert_suppression_window_without_preload_content( :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Optional parameter on whether or not to expand alert related resources. Without this parameter, there's no default expansion. For example, to expand the \"tests\" resource, use the `?expand=test` query. - :type expand: List[Expand] + :type expand: List[ExpandAlertTestOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of diff --git a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/__init__.py b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/__init__.py index 1151fc6ef..ea158df4b 100644 --- a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/__init__.py +++ b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/__init__.py @@ -19,6 +19,7 @@ from thousandeyes_sdk.alerts.models.alert_links import AlertLinks from thousandeyes_sdk.alerts.models.alert_meta import AlertMeta from thousandeyes_sdk.alerts.models.alert_metric_detail import AlertMetricDetail +from thousandeyes_sdk.alerts.models.alert_notification import AlertNotification from thousandeyes_sdk.alerts.models.alert_rounds_violation_mode import AlertRoundsViolationMode from thousandeyes_sdk.alerts.models.alert_rule import AlertRule from thousandeyes_sdk.alerts.models.alert_suppression_window import AlertSuppressionWindow @@ -38,11 +39,10 @@ from thousandeyes_sdk.alerts.models.end_repeat import EndRepeat from thousandeyes_sdk.alerts.models.end_repeat_type import EndRepeatType from thousandeyes_sdk.alerts.models.error import Error -from thousandeyes_sdk.alerts.models.expand import Expand +from thousandeyes_sdk.alerts.models.expand_alert_test_options import ExpandAlertTestOptions from thousandeyes_sdk.alerts.models.interval_type import IntervalType from thousandeyes_sdk.alerts.models.legacy_alert import LegacyAlert from thousandeyes_sdk.alerts.models.link import Link -from thousandeyes_sdk.alerts.models.notification import Notification from thousandeyes_sdk.alerts.models.notification_custom_webhook import NotificationCustomWebhook from thousandeyes_sdk.alerts.models.notification_email import NotificationEmail from thousandeyes_sdk.alerts.models.notification_third_party import NotificationThirdParty diff --git a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/alert.py b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/alert.py index 79846a0d6..845bd3f25 100644 --- a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/alert.py +++ b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/alert.py @@ -33,8 +33,8 @@ class Alert(BaseModel): """ # noqa: E501 id: Optional[StrictStr] = Field(default=None, description="A unique ID for each individual alert occurrence.") alert_type: Optional[AlertType] = Field(default=None, alias="alertType") - start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) for querying alerts.", alias="startDate") - end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) for querying alerts.", alias="endDate") + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") violation_count: Optional[StrictInt] = Field(default=None, description="Number of sources that meet the alert criteria.", alias="violationCount") duration: Optional[StrictInt] = Field(default=None, description="Duration in seconds the alert was active") suppressed: Optional[StrictBool] = Field(default=None, description="Indicates whether the alert is currently suppressed by a real-time ASW.") diff --git a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/alert_detail.py b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/alert_detail.py index 764cb99e4..4667450b9 100644 --- a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/alert_detail.py +++ b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/alert_detail.py @@ -34,8 +34,8 @@ class AlertDetail(BaseModel): """ # noqa: E501 id: Optional[StrictStr] = Field(default=None, description="A unique ID for each individual alert occurrence.") alert_type: Optional[AlertType] = Field(default=None, alias="alertType") - start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) for querying alerts.", alias="startDate") - end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) for querying alerts.", alias="endDate") + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") violation_count: Optional[StrictInt] = Field(default=None, description="Number of sources that meet the alert criteria.", alias="violationCount") duration: Optional[StrictInt] = Field(default=None, description="Duration in seconds the alert was active") suppressed: Optional[StrictBool] = Field(default=None, description="Indicates whether the alert is currently suppressed by a real-time ASW.") diff --git a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/alert_notification.py b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/alert_notification.py new file mode 100644 index 000000000..a46f22286 --- /dev/null +++ b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/alert_notification.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Alerts API + + You can manage the following alert functionalities on the ThousandEyes platform using the Alerts API: * **Alerts**: Retrieve alert details. Alerts are assigned to tests through alert rules. * **Alert Rules**: Conditions that you configure in order to highlight or be notified of events of interest in your ThousandEyes tests. When an alert rule’s conditions are met, the associated alert is triggered and the alert becomes active. It remains active until the alert is cleared. Alert rules are reusable across multiple tests.. * **Alert Suppression Windows**: Suppress alerts for tests during periods such as planned maintenance. Windows can be one-time events or recurring events to handle periodic occurrences such as monthly downtime for maintenance. For more information about the alerts, see [Alerts](https://docs.thousandeyes.com/product-documentation/alerts). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.alerts.models.notification_custom_webhook import NotificationCustomWebhook +from thousandeyes_sdk.alerts.models.notification_email import NotificationEmail +from thousandeyes_sdk.alerts.models.notification_third_party import NotificationThirdParty +from thousandeyes_sdk.alerts.models.notification_webhook import NotificationWebhook +from typing import Optional, Set +from typing_extensions import Self + +class AlertNotification(BaseModel): + """ + Alert notification object. See Alert notification integrations. + """ # noqa: E501 + email: Optional[NotificationEmail] = None + third_party: Optional[List[NotificationThirdParty]] = Field(default=None, description="Third party notifications.", alias="thirdParty") + webhook: Optional[List[NotificationWebhook]] = Field(default=None, description="Webhook notifications.") + custom_webhook: Optional[List[NotificationCustomWebhook]] = Field(default=None, description="Custom webhook notifications.", alias="customWebhook") + __properties: ClassVar[List[str]] = ["email", "thirdParty", "webhook", "customWebhook"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AlertNotification from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of email + if self.email: + _dict['email'] = self.email.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in third_party (list) + _items = [] + if self.third_party: + for _item in self.third_party: + if _item: + _items.append(_item.to_dict()) + _dict['thirdParty'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in webhook (list) + _items = [] + if self.webhook: + for _item in self.webhook: + if _item: + _items.append(_item.to_dict()) + _dict['webhook'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_webhook (list) + _items = [] + if self.custom_webhook: + for _item in self.custom_webhook: + if _item: + _items.append(_item.to_dict()) + _dict['customWebhook'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AlertNotification from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": NotificationEmail.from_dict(obj["email"]) if obj.get("email") is not None else None, + "thirdParty": [NotificationThirdParty.from_dict(_item) for _item in obj["thirdParty"]] if obj.get("thirdParty") is not None else None, + "webhook": [NotificationWebhook.from_dict(_item) for _item in obj["webhook"]] if obj.get("webhook") is not None else None, + "customWebhook": [NotificationCustomWebhook.from_dict(_item) for _item in obj["customWebhook"]] if obj.get("customWebhook") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/base_alert.py b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/base_alert.py index 93fbb8eca..b0a5101d7 100644 --- a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/base_alert.py +++ b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/base_alert.py @@ -31,8 +31,8 @@ class BaseAlert(BaseModel): """ # noqa: E501 id: Optional[StrictStr] = Field(default=None, description="A unique ID for each individual alert occurrence.") alert_type: Optional[AlertType] = Field(default=None, alias="alertType") - start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) for querying alerts.", alias="startDate") - end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) for querying alerts.", alias="endDate") + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") violation_count: Optional[StrictInt] = Field(default=None, description="Number of sources that meet the alert criteria.", alias="violationCount") duration: Optional[StrictInt] = Field(default=None, description="Duration in seconds the alert was active") suppressed: Optional[StrictBool] = Field(default=None, description="Indicates whether the alert is currently suppressed by a real-time ASW.") diff --git a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/expand_alert_test_options.py b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/expand_alert_test_options.py new file mode 100644 index 000000000..a8f173c13 --- /dev/null +++ b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/expand_alert_test_options.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + Alerts API + + You can manage the following alert functionalities on the ThousandEyes platform using the Alerts API: * **Alerts**: Retrieve alert details. Alerts are assigned to tests through alert rules. * **Alert Rules**: Conditions that you configure in order to highlight or be notified of events of interest in your ThousandEyes tests. When an alert rule’s conditions are met, the associated alert is triggered and the alert becomes active. It remains active until the alert is cleared. Alert rules are reusable across multiple tests.. * **Alert Suppression Windows**: Suppress alerts for tests during periods such as planned maintenance. Windows can be one-time events or recurring events to handle periodic occurrences such as monthly downtime for maintenance. For more information about the alerts, see [Alerts](https://docs.thousandeyes.com/product-documentation/alerts). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ExpandAlertTestOptions(str, Enum): + """ + ExpandAlertTestOptions + """ + + """ + allowed enum values + """ + TEST = 'test' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ExpandAlertTestOptions from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/rule.py b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/rule.py index 31e226c00..d4ebda5b9 100644 --- a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/rule.py +++ b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/rule.py @@ -19,9 +19,9 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from thousandeyes_sdk.alerts.models.alert_direction import AlertDirection +from thousandeyes_sdk.alerts.models.alert_notification import AlertNotification from thousandeyes_sdk.alerts.models.alert_rounds_violation_mode import AlertRoundsViolationMode from thousandeyes_sdk.alerts.models.alert_type import AlertType -from thousandeyes_sdk.alerts.models.notification import Notification from thousandeyes_sdk.alerts.models.self_links import SelfLinks from thousandeyes_sdk.alerts.models.sensitivity_level import SensitivityLevel from thousandeyes_sdk.alerts.models.severity import Severity @@ -47,7 +47,7 @@ class Rule(BaseModel): include_covered_prefixes: Optional[StrictBool] = Field(default=None, description="Set true to include covered prefixes in the BGP alert rule. Only applicable to BGP alert rules.", alias="includeCoveredPrefixes") sensitivity_level: Optional[SensitivityLevel] = Field(default=None, alias="sensitivityLevel") severity: Optional[Severity] = None - notifications: Optional[Notification] = None + notifications: Optional[AlertNotification] = None test_ids: Optional[List[StrictStr]] = Field(default=None, description="Array of test IDs to link to alert rule (get `testId` from `/tests` endpoint).", alias="testIds") links: Optional[SelfLinks] = Field(default=None, alias="_links") __properties: ClassVar[List[str]] = ["ruleId", "ruleName", "expression", "direction", "notifyOnClear", "isDefault", "alertType", "minimumSources", "minimumSourcesPct", "roundsViolatingMode", "roundsViolatingOutOf", "roundsViolatingRequired", "includeCoveredPrefixes", "sensitivityLevel", "severity", "notifications", "testIds", "_links"] @@ -127,7 +127,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "includeCoveredPrefixes": obj.get("includeCoveredPrefixes"), "sensitivityLevel": obj.get("sensitivityLevel"), "severity": obj.get("severity"), - "notifications": Notification.from_dict(obj["notifications"]) if obj.get("notifications") is not None else None, + "notifications": AlertNotification.from_dict(obj["notifications"]) if obj.get("notifications") is not None else None, "testIds": obj.get("testIds"), "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None }) diff --git a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/rule_detail.py b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/rule_detail.py index e1c7498bf..634095e3c 100644 --- a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/rule_detail.py +++ b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/rule_detail.py @@ -19,10 +19,10 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from thousandeyes_sdk.alerts.models.alert_direction import AlertDirection +from thousandeyes_sdk.alerts.models.alert_notification import AlertNotification from thousandeyes_sdk.alerts.models.alert_rounds_violation_mode import AlertRoundsViolationMode from thousandeyes_sdk.alerts.models.alert_type import AlertType from thousandeyes_sdk.alerts.models.base_test import BaseTest -from thousandeyes_sdk.alerts.models.notification import Notification from thousandeyes_sdk.alerts.models.self_links import SelfLinks from thousandeyes_sdk.alerts.models.sensitivity_level import SensitivityLevel from thousandeyes_sdk.alerts.models.severity import Severity @@ -48,7 +48,7 @@ class RuleDetail(BaseModel): include_covered_prefixes: Optional[StrictBool] = Field(default=None, description="Set true to include covered prefixes in the BGP alert rule. Only applicable to BGP alert rules.", alias="includeCoveredPrefixes") sensitivity_level: Optional[SensitivityLevel] = Field(default=None, alias="sensitivityLevel") severity: Optional[Severity] = None - notifications: Optional[Notification] = None + notifications: Optional[AlertNotification] = None tests: Optional[List[BaseTest]] = None links: Optional[SelfLinks] = Field(default=None, alias="_links") __properties: ClassVar[List[str]] = ["ruleId", "ruleName", "expression", "direction", "notifyOnClear", "isDefault", "alertType", "minimumSources", "minimumSourcesPct", "roundsViolatingMode", "roundsViolatingOutOf", "roundsViolatingRequired", "includeCoveredPrefixes", "sensitivityLevel", "severity", "notifications", "tests", "_links"] @@ -137,7 +137,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "includeCoveredPrefixes": obj.get("includeCoveredPrefixes"), "sensitivityLevel": obj.get("sensitivityLevel"), "severity": obj.get("severity"), - "notifications": Notification.from_dict(obj["notifications"]) if obj.get("notifications") is not None else None, + "notifications": AlertNotification.from_dict(obj["notifications"]) if obj.get("notifications") is not None else None, "tests": [BaseTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None, "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None }) diff --git a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/rule_detail_update.py b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/rule_detail_update.py index 8b09bf2b0..9cee41d4a 100644 --- a/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/rule_detail_update.py +++ b/thousandeyes-sdk-alerts/src/thousandeyes_sdk/alerts/models/rule_detail_update.py @@ -19,9 +19,9 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from thousandeyes_sdk.alerts.models.alert_direction import AlertDirection +from thousandeyes_sdk.alerts.models.alert_notification import AlertNotification from thousandeyes_sdk.alerts.models.alert_rounds_violation_mode import AlertRoundsViolationMode from thousandeyes_sdk.alerts.models.alert_type import AlertType -from thousandeyes_sdk.alerts.models.notification import Notification from thousandeyes_sdk.alerts.models.sensitivity_level import SensitivityLevel from thousandeyes_sdk.alerts.models.severity import Severity from typing import Optional, Set @@ -46,7 +46,7 @@ class RuleDetailUpdate(BaseModel): include_covered_prefixes: Optional[StrictBool] = Field(default=None, description="Set true to include covered prefixes in the BGP alert rule. Only applicable to BGP alert rules.", alias="includeCoveredPrefixes") sensitivity_level: Optional[SensitivityLevel] = Field(default=None, alias="sensitivityLevel") severity: Optional[Severity] = None - notifications: Optional[Notification] = None + notifications: Optional[AlertNotification] = None test_ids: Optional[List[StrictStr]] = Field(default=None, description="Array of test IDs to link to alert rule (get `testId` from `/tests` endpoint).", alias="testIds") __properties: ClassVar[List[str]] = ["ruleId", "ruleName", "expression", "direction", "notifyOnClear", "isDefault", "alertType", "minimumSources", "minimumSourcesPct", "roundsViolatingMode", "roundsViolatingOutOf", "roundsViolatingRequired", "includeCoveredPrefixes", "sensitivityLevel", "severity", "notifications", "testIds"] @@ -122,7 +122,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "includeCoveredPrefixes": obj.get("includeCoveredPrefixes"), "sensitivityLevel": obj.get("sensitivityLevel"), "severity": obj.get("severity"), - "notifications": Notification.from_dict(obj["notifications"]) if obj.get("notifications") is not None else None, + "notifications": AlertNotification.from_dict(obj["notifications"]) if obj.get("notifications") is not None else None, "testIds": obj.get("testIds") }) return _obj diff --git a/thousandeyes-sdk-alerts/test/test_alert_rules_api.py b/thousandeyes-sdk-alerts/test/test_alert_rules_api.py index e116549ac..f4398b6ba 100644 --- a/thousandeyes-sdk-alerts/test/test_alert_rules_api.py +++ b/thousandeyes-sdk-alerts/test/test_alert_rules_api.py @@ -213,7 +213,7 @@ def test_get_alert_rule_models_validation(self) -> None: "ruleId" : "127094", "direction" : "to-target" } ], - "interval" : 120, + "interval" : 60, "alertsEnabled" : true, "enabled" : true }, { @@ -246,7 +246,7 @@ def test_get_alert_rule_models_validation(self) -> None: "ruleId" : "127094", "direction" : "to-target" } ], - "interval" : 120, + "interval" : 60, "alertsEnabled" : true, "enabled" : true } ], diff --git a/thousandeyes-sdk-alerts/test/test_alert_suppression_windows_api.py b/thousandeyes-sdk-alerts/test/test_alert_suppression_windows_api.py index 86e569c6d..5efc40a87 100644 --- a/thousandeyes-sdk-alerts/test/test_alert_suppression_windows_api.py +++ b/thousandeyes-sdk-alerts/test/test_alert_suppression_windows_api.py @@ -90,7 +90,7 @@ def test_create_alert_suppression_window_models_validation(self) -> None: "ruleId" : "127094", "direction" : "to-target" } ], - "interval" : 120, + "interval" : 60, "alertsEnabled" : true, "enabled" : true }, { @@ -123,7 +123,7 @@ def test_create_alert_suppression_window_models_validation(self) -> None: "ruleId" : "127094", "direction" : "to-target" } ], - "interval" : 120, + "interval" : 60, "alertsEnabled" : true, "enabled" : true } ], @@ -201,7 +201,7 @@ def test_get_alert_suppression_window_models_validation(self) -> None: "ruleId" : "127094", "direction" : "to-target" } ], - "interval" : 120, + "interval" : 60, "alertsEnabled" : true, "enabled" : true }, { @@ -234,7 +234,7 @@ def test_get_alert_suppression_window_models_validation(self) -> None: "ruleId" : "127094", "direction" : "to-target" } ], - "interval" : 120, + "interval" : 60, "alertsEnabled" : true, "enabled" : true } ], @@ -417,7 +417,7 @@ def test_update_alert_suppression_window_models_validation(self) -> None: "ruleId" : "127094", "direction" : "to-target" } ], - "interval" : 120, + "interval" : 60, "alertsEnabled" : true, "enabled" : true }, { @@ -450,7 +450,7 @@ def test_update_alert_suppression_window_models_validation(self) -> None: "ruleId" : "127094", "direction" : "to-target" } ], - "interval" : 120, + "interval" : 60, "alertsEnabled" : true, "enabled" : true } ], diff --git a/thousandeyes-sdk-alerts/test/test_alerts_api.py b/thousandeyes-sdk-alerts/test/test_alerts_api.py index e640c5816..47f834510 100644 --- a/thousandeyes-sdk-alerts/test/test_alerts_api.py +++ b/thousandeyes-sdk-alerts/test/test_alerts_api.py @@ -37,7 +37,7 @@ def test_get_alert_models_validation(self) -> None: "severity" : "major", "alertType" : "http-server", "violationCount" : 2, - "endDate" : "2020-04-23T13:43:16Z", + "endDate" : "2022-07-18T22:00:54Z", "_links" : { "appLink" : { "hreflang" : "hreflang", @@ -109,7 +109,7 @@ def test_get_alert_models_validation(self) -> None: "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", "suppressed" : false, "state" : "active", - "startDate" : "2020-04-23T13:43:16Z" + "startDate" : "2022-07-17T22:00:54Z" }""" response_loaded_json = json.loads(response_body_json) @@ -124,7 +124,7 @@ def test_get_alerts_models_validation(self) -> None: "alerts" : [ { "severity" : "MAJOR", "alertType" : "http-server", - "endDate" : "2020-04-23T13:43:16Z", + "endDate" : "2022-07-18T22:00:54Z", "_links" : { "appLink" : { "hreflang" : "hreflang", @@ -187,12 +187,12 @@ def test_get_alerts_models_validation(self) -> None: "ruleId" : 127094, "permalink" : "https://app.thousandeyes.com/alerts/list?__a=75&alertId=2783&agentId=12", "alertState" : "active", - "startDate" : "2020-04-23T13:43:16Z", + "startDate" : "2022-07-17T22:00:54Z", "alertRuleId" : "127094" }, { "severity" : "MAJOR", "alertType" : "http-server", - "endDate" : "2020-04-23T13:43:16Z", + "endDate" : "2022-07-18T22:00:54Z", "_links" : { "appLink" : { "hreflang" : "hreflang", @@ -255,7 +255,7 @@ def test_get_alerts_models_validation(self) -> None: "ruleId" : 127094, "permalink" : "https://app.thousandeyes.com/alerts/list?__a=75&alertId=2783&agentId=12", "alertState" : "active", - "startDate" : "2020-04-23T13:43:16Z", + "startDate" : "2022-07-17T22:00:54Z", "alertRuleId" : "127094" } ], "_links" : { diff --git a/thousandeyes-sdk-bgp-monitors/.openapi-generator/FILES b/thousandeyes-sdk-bgp-monitors/.openapi-generator/FILES index 3329bfe12..51ff2ec6a 100644 --- a/thousandeyes-sdk-bgp-monitors/.openapi-generator/FILES +++ b/thousandeyes-sdk-bgp-monitors/.openapi-generator/FILES @@ -1,9 +1,9 @@ .openapi-generator-ignore MANIFEST.in README.md +docs/BGPMonitorsApi.md docs/Error.md docs/Link.md -docs/ListBGPMonitorsApi.md docs/Monitor.md docs/MonitorType.md docs/Monitors.md @@ -13,7 +13,7 @@ pyproject.toml setup.cfg src/thousandeyes_sdk/bgp_monitors/__init__.py src/thousandeyes_sdk/bgp_monitors/api/__init__.py -src/thousandeyes_sdk/bgp_monitors/api/list_bgp_monitors_api.py +src/thousandeyes_sdk/bgp_monitors/api/bgp_monitors_api.py src/thousandeyes_sdk/bgp_monitors/models/__init__.py src/thousandeyes_sdk/bgp_monitors/models/error.py src/thousandeyes_sdk/bgp_monitors/models/link.py @@ -24,5 +24,5 @@ src/thousandeyes_sdk/bgp_monitors/models/self_links.py src/thousandeyes_sdk/bgp_monitors/models/unauthorized_error.py src/thousandeyes_sdk/bgp_monitors/py.typed test/__init__.py -test/test_list_bgp_monitors_api.py +test/test_bgp_monitors_api.py test/test_utils.py diff --git a/thousandeyes-sdk-bgp-monitors/README.md b/thousandeyes-sdk-bgp-monitors/README.md index eac8e5156..ea1e36c23 100644 --- a/thousandeyes-sdk-bgp-monitors/README.md +++ b/thousandeyes-sdk-bgp-monitors/README.md @@ -9,7 +9,7 @@ For more information about monitors, see [Inside-Out BGP Visibility](https://doc This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -81,16 +81,16 @@ configuration = thousandeyes_sdk.core.Configuration( # Enter a context with an instance of the API client with thousandeyes_sdk.core.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.bgp_monitors.ListBGPMonitorsApi(api_client) + api_instance = thousandeyes_sdk.bgp_monitors.BGPMonitorsApi(api_client) aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) try: # List BGP monitors api_response = api_instance.get_bgp_monitors(aid=aid) - print("The response of ListBGPMonitorsApi->get_bgp_monitors:\n") + print("The response of BGPMonitorsApi->get_bgp_monitors:\n") pprint(api_response) except ApiException as e: - print("Exception when calling ListBGPMonitorsApi->get_bgp_monitors: %s\n" % e) + print("Exception when calling BGPMonitorsApi->get_bgp_monitors: %s\n" % e) ``` @@ -100,7 +100,7 @@ All URIs are relative to *https://api.thousandeyes.com/v7* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*ListBGPMonitorsApi* | [**get_bgp_monitors**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-bgp-monitors/docs/ListBGPMonitorsApi.md#get_bgp_monitors) | **GET** /monitors | List BGP monitors +*BGPMonitorsApi* | [**get_bgp_monitors**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-bgp-monitors/docs/BGPMonitorsApi.md#get_bgp_monitors) | **GET** /monitors | List BGP monitors ## Documentation For Models diff --git a/thousandeyes-sdk-bgp-monitors/docs/BGPMonitorsApi.md b/thousandeyes-sdk-bgp-monitors/docs/BGPMonitorsApi.md new file mode 100644 index 000000000..edd52f32e --- /dev/null +++ b/thousandeyes-sdk-bgp-monitors/docs/BGPMonitorsApi.md @@ -0,0 +1,92 @@ +# thousandeyes_sdk.bgp_monitors.BGPMonitorsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_bgp_monitors**](BGPMonitorsApi.md#get_bgp_monitors) | **GET** /monitors | List BGP monitors + + +# **get_bgp_monitors** +> Monitors get_bgp_monitors(aid=aid) + +List BGP monitors + +Retrieves a list of BGP monitors available to your account in ThousandEyes, including public and private feeds. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.bgp_monitors +from thousandeyes_sdk.bgp_monitors.models.monitors import Monitors +from thousandeyes_sdk.bgp_monitors.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.bgp_monitors.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.bgp_monitors.BGPMonitorsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List BGP monitors + api_response = api_instance.get_bgp_monitors(aid=aid) + print("The response of BGPMonitorsApi->get_bgp_monitors:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BGPMonitorsApi->get_bgp_monitors: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**Monitors**](Monitors.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-bgp-monitors/src/thousandeyes_sdk/bgp_monitors/__init__.py b/thousandeyes-sdk-bgp-monitors/src/thousandeyes_sdk/bgp_monitors/__init__.py index 0b7b6d26b..8d3885cc4 100644 --- a/thousandeyes-sdk-bgp-monitors/src/thousandeyes_sdk/bgp_monitors/__init__.py +++ b/thousandeyes-sdk-bgp-monitors/src/thousandeyes_sdk/bgp_monitors/__init__.py @@ -14,7 +14,7 @@ # import apis into sdk package -from thousandeyes_sdk.bgp_monitors.api.list_bgp_monitors_api import ListBGPMonitorsApi +from thousandeyes_sdk.bgp_monitors.api.bgp_monitors_api import BGPMonitorsApi # import models into sdk package diff --git a/thousandeyes-sdk-bgp-monitors/src/thousandeyes_sdk/bgp_monitors/api/__init__.py b/thousandeyes-sdk-bgp-monitors/src/thousandeyes_sdk/bgp_monitors/api/__init__.py index 36c92d395..0cfdfbde2 100644 --- a/thousandeyes-sdk-bgp-monitors/src/thousandeyes_sdk/bgp_monitors/api/__init__.py +++ b/thousandeyes-sdk-bgp-monitors/src/thousandeyes_sdk/bgp_monitors/api/__init__.py @@ -1,5 +1,5 @@ # flake8: noqa # import apis into api package -from thousandeyes_sdk.bgp_monitors.api.list_bgp_monitors_api import ListBGPMonitorsApi +from thousandeyes_sdk.bgp_monitors.api.bgp_monitors_api import BGPMonitorsApi diff --git a/thousandeyes-sdk-bgp-monitors/src/thousandeyes_sdk/bgp_monitors/api/bgp_monitors_api.py b/thousandeyes-sdk-bgp-monitors/src/thousandeyes_sdk/bgp_monitors/api/bgp_monitors_api.py new file mode 100644 index 000000000..68f532c1c --- /dev/null +++ b/thousandeyes-sdk-bgp-monitors/src/thousandeyes_sdk/bgp_monitors/api/bgp_monitors_api.py @@ -0,0 +1,321 @@ +# coding: utf-8 + +""" + BGP Monitors API + + Retrieve information about BGP monitors available to your ThousandEyes account. ThousandEyes ingests BGP routing data from dozens of global BGP collectors and automatically integrates that visibility as a configurable layer under service, network, and path visualization layers. When you specify a service URL in a test, layered BGP tests automatically track reachability and path changes for any relevant prefix. When you use an IP address as the target for a test, the ThousandEyes platform monitors the relevant internet-routed prefix. You can also create specific BGP monitoring for a prefix, and can alert on hijacks and leaks. For more information about monitors, see [Inside-Out BGP Visibility](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/bgp-tests/inside-out-bgp-visibility). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.bgp_monitors.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.bgp_monitors.models.monitors import Monitors + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class BGPMonitorsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-bgp-monitors")) + self.api_client = api_client + + + @validate_call + def get_bgp_monitors( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Monitors: + """List BGP monitors + + Retrieves a list of BGP monitors available to your account in ThousandEyes, including public and private feeds. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bgp_monitors_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Monitors", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.bgp_monitors.models, + ).data + + + @validate_call + def get_bgp_monitors_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Monitors]: + """List BGP monitors + + Retrieves a list of BGP monitors available to your account in ThousandEyes, including public and private feeds. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bgp_monitors_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Monitors", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.bgp_monitors.models, + ) + + + @validate_call + def get_bgp_monitors_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List BGP monitors + + Retrieves a list of BGP monitors available to your account in ThousandEyes, including public and private feeds. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bgp_monitors_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Monitors", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_bgp_monitors_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/monitors', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-bgp-monitors/test/test_bgp_monitors_api.py b/thousandeyes-sdk-bgp-monitors/test/test_bgp_monitors_api.py new file mode 100644 index 000000000..845c6cee5 --- /dev/null +++ b/thousandeyes-sdk-bgp-monitors/test/test_bgp_monitors_api.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + BGP Monitors API + + Retrieve information about BGP monitors available to your ThousandEyes account. ThousandEyes ingests BGP routing data from dozens of global BGP collectors and automatically integrates that visibility as a configurable layer under service, network, and path visualization layers. When you specify a service URL in a test, layered BGP tests automatically track reachability and path changes for any relevant prefix. When you use an IP address as the target for a test, the ThousandEyes platform monitors the relevant internet-routed prefix. You can also create specific BGP monitoring for a prefix, and can alert on hijacks and leaks. For more information about monitors, see [Inside-Out BGP Visibility](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/bgp-tests/inside-out-bgp-visibility). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.bgp_monitors.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.bgp_monitors.api.bgp_monitors_api import BGPMonitorsApi + + +class TestBGPMonitorsApi(unittest.TestCase): + """BGPMonitorsApi unit test stubs""" + + def setUp(self) -> None: + self.api = BGPMonitorsApi() + + def tearDown(self) -> None: + pass + + def test_get_bgp_monitors_models_validation(self) -> None: + """Test case for get_bgp_monitors request and response models""" + + response_body_json = """ + { + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.bgp_monitors.models.Monitors.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-credentials/README.md b/thousandeyes-sdk-credentials/README.md index a95eb3b9e..24d993d64 100644 --- a/thousandeyes-sdk-credentials/README.md +++ b/thousandeyes-sdk-credentials/README.md @@ -13,7 +13,7 @@ For more information about credentials, see [Working With Secure Credentials](ht This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-dashboards/.openapi-generator/FILES b/thousandeyes-sdk-dashboards/.openapi-generator/FILES index bb3b6d053..76b65817d 100644 --- a/thousandeyes-sdk-dashboards/.openapi-generator/FILES +++ b/thousandeyes-sdk-dashboards/.openapi-generator/FILES @@ -29,7 +29,6 @@ docs/ApiDataSourceFilter.md docs/ApiDataSourceFilters.md docs/ApiDefaultTimespan.md docs/ApiDuration.md -docs/ApiDurationUnit.md docs/ApiGeoMapWidget.md docs/ApiGraphletPoint.md docs/ApiGroupedBarchartWidget.md @@ -152,7 +151,6 @@ src/thousandeyes_sdk/dashboards/models/api_data_source_filter.py src/thousandeyes_sdk/dashboards/models/api_data_source_filters.py src/thousandeyes_sdk/dashboards/models/api_default_timespan.py src/thousandeyes_sdk/dashboards/models/api_duration.py -src/thousandeyes_sdk/dashboards/models/api_duration_unit.py src/thousandeyes_sdk/dashboards/models/api_geo_map_widget.py src/thousandeyes_sdk/dashboards/models/api_graphlet_point.py src/thousandeyes_sdk/dashboards/models/api_grouped_barchart_widget.py diff --git a/thousandeyes-sdk-dashboards/README.md b/thousandeyes-sdk-dashboards/README.md index 1bebfbb81..4b6977367 100644 --- a/thousandeyes-sdk-dashboards/README.md +++ b/thousandeyes-sdk-dashboards/README.md @@ -3,7 +3,7 @@ Manage ThousandEyes Dashboards. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -144,7 +144,6 @@ Class | Method | HTTP request | Description - [ApiDataSourceFilters](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-dashboards/docs/ApiDataSourceFilters.md) - [ApiDefaultTimespan](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-dashboards/docs/ApiDefaultTimespan.md) - [ApiDuration](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-dashboards/docs/ApiDuration.md) - - [ApiDurationUnit](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-dashboards/docs/ApiDurationUnit.md) - [ApiGeoMapWidget](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-dashboards/docs/ApiGeoMapWidget.md) - [ApiGraphletPoint](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-dashboards/docs/ApiGraphletPoint.md) - [ApiGroupedBarchartWidget](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-dashboards/docs/ApiGroupedBarchartWidget.md) diff --git a/thousandeyes-sdk-dashboards/docs/ActiveWithin.md b/thousandeyes-sdk-dashboards/docs/ActiveWithin.md index e9b0220f6..ea08de893 100644 --- a/thousandeyes-sdk-dashboards/docs/ActiveWithin.md +++ b/thousandeyes-sdk-dashboards/docs/ActiveWithin.md @@ -1,5 +1,6 @@ # ActiveWithin +Timespan in which alerts must have been active to appear in the widget. ## Properties diff --git a/thousandeyes-sdk-dashboards/docs/DashboardSnapshotsApi.md b/thousandeyes-sdk-dashboards/docs/DashboardSnapshotsApi.md index ba07a002b..53cecbb23 100644 --- a/thousandeyes-sdk-dashboards/docs/DashboardSnapshotsApi.md +++ b/thousandeyes-sdk-dashboards/docs/DashboardSnapshotsApi.md @@ -89,12 +89,12 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | Created | * Location -
| +**201** | Created | * Location -
* X-Dashboard-Snapshot-Rate-Limit-Limit -
* X-Dashboard-Snapshot-Rate-Limit-Remaining -
* X-Dashboard-Snapshot-Rate-Limit-Reset -
| **400** | Bad Request | - | **401** | Unauthorized | - | **403** | Insufficient permissions to query endpoint | - | **404** | Not found | - | -**429** | Exhausted rate limit for the organization | - | +**429** | Exhausted rate limit for snapshot creation | * X-Dashboard-Snapshot-Rate-Limit-Limit -
* X-Dashboard-Snapshot-Rate-Limit-Remaining -
* X-Dashboard-Snapshot-Rate-Limit-Reset -
| **500** | Internal server error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/__init__.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/__init__.py index 1f3319052..856a813cc 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/__init__.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/__init__.py @@ -48,7 +48,6 @@ from thousandeyes_sdk.dashboards.models.api_data_source_filters import ApiDataSourceFilters from thousandeyes_sdk.dashboards.models.api_default_timespan import ApiDefaultTimespan from thousandeyes_sdk.dashboards.models.api_duration import ApiDuration -from thousandeyes_sdk.dashboards.models.api_duration_unit import ApiDurationUnit from thousandeyes_sdk.dashboards.models.api_geo_map_widget import ApiGeoMapWidget from thousandeyes_sdk.dashboards.models.api_graphlet_point import ApiGraphletPoint from thousandeyes_sdk.dashboards.models.api_grouped_barchart_widget import ApiGroupedBarchartWidget diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/api/dashboard_snapshots_api.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/api/dashboard_snapshots_api.py index 0f1727d58..b1a361342 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/api/dashboard_snapshots_api.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/api/dashboard_snapshots_api.py @@ -110,7 +110,7 @@ def create_dashboard_snapshot( '401': "UnauthorizedError", '403': "Error", '404': "Error", - '429': "Error", + '429': None, '500': "Error", } response_data = self.api_client.call_api( @@ -188,7 +188,7 @@ def create_dashboard_snapshot_with_http_info( '401': "UnauthorizedError", '403': "Error", '404': "Error", - '429': "Error", + '429': None, '500': "Error", } response_data = self.api_client.call_api( @@ -266,7 +266,7 @@ def create_dashboard_snapshot_without_preload_content( '401': "UnauthorizedError", '403': "Error", '404': "Error", - '429': "Error", + '429': None, '500': "Error", } response_data = self.api_client.call_api( diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/__init__.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/__init__.py index 5ed5b9155..1fa563ebc 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/__init__.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/__init__.py @@ -41,7 +41,6 @@ from thousandeyes_sdk.dashboards.models.api_data_source_filters import ApiDataSourceFilters from thousandeyes_sdk.dashboards.models.api_default_timespan import ApiDefaultTimespan from thousandeyes_sdk.dashboards.models.api_duration import ApiDuration -from thousandeyes_sdk.dashboards.models.api_duration_unit import ApiDurationUnit from thousandeyes_sdk.dashboards.models.api_geo_map_widget import ApiGeoMapWidget from thousandeyes_sdk.dashboards.models.api_graphlet_point import ApiGraphletPoint from thousandeyes_sdk.dashboards.models.api_grouped_barchart_widget import ApiGroupedBarchartWidget diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/active_within.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/active_within.py index 2a67b272d..a43cbe166 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/active_within.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/active_within.py @@ -24,7 +24,7 @@ class ActiveWithin(BaseModel): """ - ActiveWithin + Timespan in which alerts must have been active to appear in the widget. """ # noqa: E501 value: Optional[StrictInt] = Field(default=None, description="Timespan value.") unit: Optional[LegacyDurationUnit] = None diff --git a/thousandeyes-sdk-emulation/.openapi-generator/FILES b/thousandeyes-sdk-emulation/.openapi-generator/FILES index ac0823f81..90ceb9ecd 100644 --- a/thousandeyes-sdk-emulation/.openapi-generator/FILES +++ b/thousandeyes-sdk-emulation/.openapi-generator/FILES @@ -7,7 +7,7 @@ docs/EmulatedDeviceResponse.md docs/EmulatedDeviceResponses.md docs/EmulationApi.md docs/Error.md -docs/Expand.md +docs/ExpandEmulatedDeviceOptions.md docs/Link.md docs/SelfLinks.md docs/UnauthorizedError.md @@ -24,7 +24,7 @@ src/thousandeyes_sdk/emulation/models/emulated_device_category.py src/thousandeyes_sdk/emulation/models/emulated_device_response.py src/thousandeyes_sdk/emulation/models/emulated_device_responses.py src/thousandeyes_sdk/emulation/models/error.py -src/thousandeyes_sdk/emulation/models/expand.py +src/thousandeyes_sdk/emulation/models/expand_emulated_device_options.py src/thousandeyes_sdk/emulation/models/link.py src/thousandeyes_sdk/emulation/models/self_links.py src/thousandeyes_sdk/emulation/models/unauthorized_error.py diff --git a/thousandeyes-sdk-emulation/README.md b/thousandeyes-sdk-emulation/README.md index 8f4311acb..5a5ac2b39 100644 --- a/thousandeyes-sdk-emulation/README.md +++ b/thousandeyes-sdk-emulation/README.md @@ -9,7 +9,7 @@ To access Emulation API endpoints, the following permissions are required: This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -113,7 +113,7 @@ Class | Method | HTTP request | Description - [EmulatedDeviceResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-emulation/docs/EmulatedDeviceResponse.md) - [EmulatedDeviceResponses](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-emulation/docs/EmulatedDeviceResponses.md) - [Error](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-emulation/docs/Error.md) - - [Expand](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-emulation/docs/Expand.md) + - [ExpandEmulatedDeviceOptions](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-emulation/docs/ExpandEmulatedDeviceOptions.md) - [Link](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-emulation/docs/Link.md) - [SelfLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-emulation/docs/SelfLinks.md) - [UnauthorizedError](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-emulation/docs/UnauthorizedError.md) diff --git a/thousandeyes-sdk-emulation/docs/EmulationApi.md b/thousandeyes-sdk-emulation/docs/EmulationApi.md index 21cf89165..28c53df2d 100644 --- a/thousandeyes-sdk-emulation/docs/EmulationApi.md +++ b/thousandeyes-sdk-emulation/docs/EmulationApi.md @@ -109,7 +109,7 @@ Retrieves a list of emulated devices available for browser tests. ```python import thousandeyes_sdk.emulation from thousandeyes_sdk.emulation.models.emulated_device_responses import EmulatedDeviceResponses -from thousandeyes_sdk.emulation.models.expand import Expand +from thousandeyes_sdk.emulation.models.expand_emulated_device_options import ExpandEmulatedDeviceOptions from thousandeyes_sdk.emulation.rest import ApiException from pprint import pprint @@ -133,7 +133,7 @@ configuration = thousandeyes_sdk.core.Configuration( with thousandeyes_sdk.emulation.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = thousandeyes_sdk.emulation.EmulationApi(api_client) - expand = [thousandeyes_sdk.emulation.Expand()] # List[Expand] | Optional query parameter that controls whether user-agent templates are included in the response. By default, user-agent templates are not included. To include them, add `?expand=user-agent` to the request. (optional) + expand = [thousandeyes_sdk.emulation.ExpandEmulatedDeviceOptions()] # List[ExpandEmulatedDeviceOptions] | Optional query parameter that controls whether user-agent templates are included in the response. By default, user-agent templates are not included. To include them, add `?expand=user-agent` to the request. (optional) try: # List emulated devices @@ -151,7 +151,7 @@ with thousandeyes_sdk.emulation.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **expand** | [**List[Expand]**](Expand.md)| Optional query parameter that controls whether user-agent templates are included in the response. By default, user-agent templates are not included. To include them, add `?expand=user-agent` to the request. | [optional] + **expand** | [**List[ExpandEmulatedDeviceOptions]**](ExpandEmulatedDeviceOptions.md)| Optional query parameter that controls whether user-agent templates are included in the response. By default, user-agent templates are not included. To include them, add `?expand=user-agent` to the request. | [optional] ### Return type diff --git a/thousandeyes-sdk-emulation/docs/ExpandEmulatedDeviceOptions.md b/thousandeyes-sdk-emulation/docs/ExpandEmulatedDeviceOptions.md new file mode 100644 index 000000000..17daf1729 --- /dev/null +++ b/thousandeyes-sdk-emulation/docs/ExpandEmulatedDeviceOptions.md @@ -0,0 +1,11 @@ +# ExpandEmulatedDeviceOptions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-emulation/src/thousandeyes_sdk/emulation/__init__.py b/thousandeyes-sdk-emulation/src/thousandeyes_sdk/emulation/__init__.py index dd25a9d68..3fcec70d8 100644 --- a/thousandeyes-sdk-emulation/src/thousandeyes_sdk/emulation/__init__.py +++ b/thousandeyes-sdk-emulation/src/thousandeyes_sdk/emulation/__init__.py @@ -23,7 +23,7 @@ from thousandeyes_sdk.emulation.models.emulated_device_response import EmulatedDeviceResponse from thousandeyes_sdk.emulation.models.emulated_device_responses import EmulatedDeviceResponses from thousandeyes_sdk.emulation.models.error import Error -from thousandeyes_sdk.emulation.models.expand import Expand +from thousandeyes_sdk.emulation.models.expand_emulated_device_options import ExpandEmulatedDeviceOptions from thousandeyes_sdk.emulation.models.link import Link from thousandeyes_sdk.emulation.models.self_links import SelfLinks from thousandeyes_sdk.emulation.models.unauthorized_error import UnauthorizedError diff --git a/thousandeyes-sdk-emulation/src/thousandeyes_sdk/emulation/api/emulation_api.py b/thousandeyes-sdk-emulation/src/thousandeyes_sdk/emulation/api/emulation_api.py index 2bff34451..6e62d0fba 100644 --- a/thousandeyes-sdk-emulation/src/thousandeyes_sdk/emulation/api/emulation_api.py +++ b/thousandeyes-sdk-emulation/src/thousandeyes_sdk/emulation/api/emulation_api.py @@ -24,7 +24,7 @@ from thousandeyes_sdk.emulation.models.emulated_device import EmulatedDevice from thousandeyes_sdk.emulation.models.emulated_device_response import EmulatedDeviceResponse from thousandeyes_sdk.emulation.models.emulated_device_responses import EmulatedDeviceResponses -from thousandeyes_sdk.emulation.models.expand import Expand +from thousandeyes_sdk.emulation.models.expand_emulated_device_options import ExpandEmulatedDeviceOptions from thousandeyes_sdk.emulation.models.user_agents import UserAgents from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized @@ -356,7 +356,7 @@ def _create_emulated_device_serialize( @validate_call def get_emulated_devices( self, - expand: Annotated[Optional[List[Expand]], Field(description="Optional query parameter that controls whether user-agent templates are included in the response. By default, user-agent templates are not included. To include them, add `?expand=user-agent` to the request. ")] = None, + expand: Annotated[Optional[List[ExpandEmulatedDeviceOptions]], Field(description="Optional query parameter that controls whether user-agent templates are included in the response. By default, user-agent templates are not included. To include them, add `?expand=user-agent` to the request. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -375,7 +375,7 @@ def get_emulated_devices( Retrieves a list of emulated devices available for browser tests. :param expand: Optional query parameter that controls whether user-agent templates are included in the response. By default, user-agent templates are not included. To include them, add `?expand=user-agent` to the request. - :type expand: List[Expand] + :type expand: List[ExpandEmulatedDeviceOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -429,7 +429,7 @@ def get_emulated_devices( @validate_call def get_emulated_devices_with_http_info( self, - expand: Annotated[Optional[List[Expand]], Field(description="Optional query parameter that controls whether user-agent templates are included in the response. By default, user-agent templates are not included. To include them, add `?expand=user-agent` to the request. ")] = None, + expand: Annotated[Optional[List[ExpandEmulatedDeviceOptions]], Field(description="Optional query parameter that controls whether user-agent templates are included in the response. By default, user-agent templates are not included. To include them, add `?expand=user-agent` to the request. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -448,7 +448,7 @@ def get_emulated_devices_with_http_info( Retrieves a list of emulated devices available for browser tests. :param expand: Optional query parameter that controls whether user-agent templates are included in the response. By default, user-agent templates are not included. To include them, add `?expand=user-agent` to the request. - :type expand: List[Expand] + :type expand: List[ExpandEmulatedDeviceOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -502,7 +502,7 @@ def get_emulated_devices_with_http_info( @validate_call def get_emulated_devices_without_preload_content( self, - expand: Annotated[Optional[List[Expand]], Field(description="Optional query parameter that controls whether user-agent templates are included in the response. By default, user-agent templates are not included. To include them, add `?expand=user-agent` to the request. ")] = None, + expand: Annotated[Optional[List[ExpandEmulatedDeviceOptions]], Field(description="Optional query parameter that controls whether user-agent templates are included in the response. By default, user-agent templates are not included. To include them, add `?expand=user-agent` to the request. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -521,7 +521,7 @@ def get_emulated_devices_without_preload_content( Retrieves a list of emulated devices available for browser tests. :param expand: Optional query parameter that controls whether user-agent templates are included in the response. By default, user-agent templates are not included. To include them, add `?expand=user-agent` to the request. - :type expand: List[Expand] + :type expand: List[ExpandEmulatedDeviceOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of diff --git a/thousandeyes-sdk-emulation/src/thousandeyes_sdk/emulation/models/__init__.py b/thousandeyes-sdk-emulation/src/thousandeyes_sdk/emulation/models/__init__.py index 094e620c7..f84593027 100644 --- a/thousandeyes-sdk-emulation/src/thousandeyes_sdk/emulation/models/__init__.py +++ b/thousandeyes-sdk-emulation/src/thousandeyes_sdk/emulation/models/__init__.py @@ -18,7 +18,7 @@ from thousandeyes_sdk.emulation.models.emulated_device_response import EmulatedDeviceResponse from thousandeyes_sdk.emulation.models.emulated_device_responses import EmulatedDeviceResponses from thousandeyes_sdk.emulation.models.error import Error -from thousandeyes_sdk.emulation.models.expand import Expand +from thousandeyes_sdk.emulation.models.expand_emulated_device_options import ExpandEmulatedDeviceOptions from thousandeyes_sdk.emulation.models.link import Link from thousandeyes_sdk.emulation.models.self_links import SelfLinks from thousandeyes_sdk.emulation.models.unauthorized_error import UnauthorizedError diff --git a/thousandeyes-sdk-emulation/src/thousandeyes_sdk/emulation/models/expand_emulated_device_options.py b/thousandeyes-sdk-emulation/src/thousandeyes_sdk/emulation/models/expand_emulated_device_options.py new file mode 100644 index 000000000..5294e83f5 --- /dev/null +++ b/thousandeyes-sdk-emulation/src/thousandeyes_sdk/emulation/models/expand_emulated_device_options.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + Emulation API + + The Emulation API facilitates the retrieval of user-agent strings for HTTP, pageload, and transaction tests. It also enables the retrieval and addition of emulated devices for pageload and transaction tests. To access Emulation API endpoints, the following permissions are required: * `Settings Tests Read` for read operations. * `Settings Tests Update` for write operations. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ExpandEmulatedDeviceOptions(str, Enum): + """ + ExpandEmulatedDeviceOptions + """ + + """ + allowed enum values + """ + USER_MINUS_AGENT = 'user-agent' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ExpandEmulatedDeviceOptions from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-endpoint-agents/.openapi-generator/FILES b/thousandeyes-sdk-endpoint-agents/.openapi-generator/FILES index ad00d2871..c650e4542 100644 --- a/thousandeyes-sdk-endpoint-agents/.openapi-generator/FILES +++ b/thousandeyes-sdk-endpoint-agents/.openapi-generator/FILES @@ -3,7 +3,6 @@ MANIFEST.in README.md docs/AddressProfile.md docs/AddressType.md -docs/AdministrativeEndpointsApi.md docs/AgentLicenseType.md docs/AgentSearchFilters.md docs/AgentSearchRequest.md @@ -20,23 +19,24 @@ docs/BulkAgentTransferResponse.md docs/ConditionalOperator.md docs/ConnectionString.md docs/EndpointAgent.md +docs/EndpointAgentEthernetProfile.md docs/EndpointAgentLocation.md docs/EndpointAgentUpdate.md docs/EndpointAgents.md +docs/EndpointAgentsApi.md +docs/EndpointAgentsTransferApi.md docs/EndpointAsnDetails.md docs/EndpointBrowserExtension.md docs/EndpointClient.md docs/EndpointUserProfile.md docs/EndpointVpnProfile.md docs/Error.md -docs/EthernetProfile.md -docs/Expand.md +docs/ExpandEndpointAgentOptions.md docs/FilterEndpointAgentsResponse.md docs/InterfaceHardwareType.md docs/InterfaceProfile.md docs/Link.md docs/ListEndpointAgentsResponse.md -docs/ManageAgentsApi.md docs/PaginationNextAndSelfLink.md docs/PaginationNextLink.md docs/Platform.md @@ -44,7 +44,6 @@ docs/SelfLinks.md docs/SortOrder.md docs/Status.md docs/ThresholdFilterOperator.md -docs/TransferApi.md docs/UnauthorizedError.md docs/ValidationError.md docs/ValidationErrorItem.md @@ -54,9 +53,8 @@ pyproject.toml setup.cfg src/thousandeyes_sdk/endpoint_agents/__init__.py src/thousandeyes_sdk/endpoint_agents/api/__init__.py -src/thousandeyes_sdk/endpoint_agents/api/administrative_endpoints_api.py -src/thousandeyes_sdk/endpoint_agents/api/manage_agents_api.py -src/thousandeyes_sdk/endpoint_agents/api/transfer_api.py +src/thousandeyes_sdk/endpoint_agents/api/endpoint_agents_api.py +src/thousandeyes_sdk/endpoint_agents/api/endpoint_agents_transfer_api.py src/thousandeyes_sdk/endpoint_agents/models/__init__.py src/thousandeyes_sdk/endpoint_agents/models/address_profile.py src/thousandeyes_sdk/endpoint_agents/models/address_type.py @@ -76,6 +74,7 @@ src/thousandeyes_sdk/endpoint_agents/models/bulk_agent_transfer_response.py src/thousandeyes_sdk/endpoint_agents/models/conditional_operator.py src/thousandeyes_sdk/endpoint_agents/models/connection_string.py src/thousandeyes_sdk/endpoint_agents/models/endpoint_agent.py +src/thousandeyes_sdk/endpoint_agents/models/endpoint_agent_ethernet_profile.py src/thousandeyes_sdk/endpoint_agents/models/endpoint_agent_location.py src/thousandeyes_sdk/endpoint_agents/models/endpoint_agent_update.py src/thousandeyes_sdk/endpoint_agents/models/endpoint_agents.py @@ -85,8 +84,7 @@ src/thousandeyes_sdk/endpoint_agents/models/endpoint_client.py src/thousandeyes_sdk/endpoint_agents/models/endpoint_user_profile.py src/thousandeyes_sdk/endpoint_agents/models/endpoint_vpn_profile.py src/thousandeyes_sdk/endpoint_agents/models/error.py -src/thousandeyes_sdk/endpoint_agents/models/ethernet_profile.py -src/thousandeyes_sdk/endpoint_agents/models/expand.py +src/thousandeyes_sdk/endpoint_agents/models/expand_endpoint_agent_options.py src/thousandeyes_sdk/endpoint_agents/models/filter_endpoint_agents_response.py src/thousandeyes_sdk/endpoint_agents/models/interface_hardware_type.py src/thousandeyes_sdk/endpoint_agents/models/interface_profile.py @@ -106,7 +104,6 @@ src/thousandeyes_sdk/endpoint_agents/models/vpn_type.py src/thousandeyes_sdk/endpoint_agents/models/wireless_profile.py src/thousandeyes_sdk/endpoint_agents/py.typed test/__init__.py -test/test_administrative_endpoints_api.py -test/test_manage_agents_api.py -test/test_transfer_api.py +test/test_endpoint_agents_api.py +test/test_endpoint_agents_transfer_api.py test/test_utils.py diff --git a/thousandeyes-sdk-endpoint-agents/README.md b/thousandeyes-sdk-endpoint-agents/README.md index d10205f97..8c9c45734 100644 --- a/thousandeyes-sdk-endpoint-agents/README.md +++ b/thousandeyes-sdk-endpoint-agents/README.md @@ -5,7 +5,7 @@ For more information about Endpoint Agents, see [Endpoint Agents](https://docs.t This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -77,16 +77,16 @@ configuration = thousandeyes_sdk.core.Configuration( # Enter a context with an instance of the API client with thousandeyes_sdk.core.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.endpoint_agents.AdministrativeEndpointsApi(api_client) + api_instance = thousandeyes_sdk.endpoint_agents.EndpointAgentsApi(api_client) + agent_id = 'agent_id_example' # str | The identifier of the agent to operate on. aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.endpoint_agents.ExpandEndpointAgentOptions()] # List[ExpandEndpointAgentOptions] | This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. (optional) try: - # Get agent connection string - api_response = api_instance.get_endpoint_agents_connection_string(aid=aid) - print("The response of AdministrativeEndpointsApi->get_endpoint_agents_connection_string:\n") - pprint(api_response) + # Delete endpoint agent + api_instance.delete_endpoint_agent(agent_id, aid=aid, expand=expand) except ApiException as e: - print("Exception when calling AdministrativeEndpointsApi->get_endpoint_agents_connection_string: %s\n" % e) + print("Exception when calling EndpointAgentsApi->delete_endpoint_agent: %s\n" % e) ``` @@ -96,16 +96,16 @@ All URIs are relative to *https://api.thousandeyes.com/v7* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AdministrativeEndpointsApi* | [**get_endpoint_agents_connection_string**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/AdministrativeEndpointsApi.md#get_endpoint_agents_connection_string) | **GET** /endpoint/agents/connection-string | Get agent connection string -*ManageAgentsApi* | [**delete_endpoint_agent**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/ManageAgentsApi.md#delete_endpoint_agent) | **DELETE** /endpoint/agents/{agentId} | Delete endpoint agent -*ManageAgentsApi* | [**disable_endpoint_agent**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/ManageAgentsApi.md#disable_endpoint_agent) | **POST** /endpoint/agents/{agentId}/disable | Disable endpoint agent -*ManageAgentsApi* | [**enable_endpoint_agent**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/ManageAgentsApi.md#enable_endpoint_agent) | **POST** /endpoint/agents/{agentId}/enable | Enable endpoint agent -*ManageAgentsApi* | [**filter_endpoint_agents**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/ManageAgentsApi.md#filter_endpoint_agents) | **POST** /endpoint/agents/filter | Filter endpoint agents -*ManageAgentsApi* | [**get_endpoint_agent**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/ManageAgentsApi.md#get_endpoint_agent) | **GET** /endpoint/agents/{agentId} | Retrieve endpoint agent -*ManageAgentsApi* | [**get_endpoint_agents**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/ManageAgentsApi.md#get_endpoint_agents) | **GET** /endpoint/agents | List endpoint agents -*ManageAgentsApi* | [**update_endpoint_agent**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/ManageAgentsApi.md#update_endpoint_agent) | **PATCH** /endpoint/agents/{agentId} | Update endpoint agent -*TransferApi* | [**transfer_endpoint_agent**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/TransferApi.md#transfer_endpoint_agent) | **POST** /endpoint/agents/{agentId}/transfer | Transfer endpoint agent -*TransferApi* | [**transfer_endpoint_agents**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/TransferApi.md#transfer_endpoint_agents) | **POST** /endpoint/agents/transfer/bulk | Bulk transfer agents +*EndpointAgentsApi* | [**delete_endpoint_agent**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsApi.md#delete_endpoint_agent) | **DELETE** /endpoint/agents/{agentId} | Delete endpoint agent +*EndpointAgentsApi* | [**disable_endpoint_agent**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsApi.md#disable_endpoint_agent) | **POST** /endpoint/agents/{agentId}/disable | Disable endpoint agent +*EndpointAgentsApi* | [**enable_endpoint_agent**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsApi.md#enable_endpoint_agent) | **POST** /endpoint/agents/{agentId}/enable | Enable endpoint agent +*EndpointAgentsApi* | [**filter_endpoint_agents**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsApi.md#filter_endpoint_agents) | **POST** /endpoint/agents/filter | Filter endpoint agents +*EndpointAgentsApi* | [**get_endpoint_agent**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsApi.md#get_endpoint_agent) | **GET** /endpoint/agents/{agentId} | Retrieve endpoint agent +*EndpointAgentsApi* | [**get_endpoint_agents**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsApi.md#get_endpoint_agents) | **GET** /endpoint/agents | List endpoint agents +*EndpointAgentsApi* | [**get_endpoint_agents_connection_string**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsApi.md#get_endpoint_agents_connection_string) | **GET** /endpoint/agents/connection-string | Get agent connection string +*EndpointAgentsApi* | [**update_endpoint_agent**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsApi.md#update_endpoint_agent) | **PATCH** /endpoint/agents/{agentId} | Update endpoint agent +*EndpointAgentsTransferApi* | [**transfer_endpoint_agent**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsTransferApi.md#transfer_endpoint_agent) | **POST** /endpoint/agents/{agentId}/transfer | Transfer endpoint agent +*EndpointAgentsTransferApi* | [**transfer_endpoint_agents**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsTransferApi.md#transfer_endpoint_agents) | **POST** /endpoint/agents/transfer/bulk | Bulk transfer agents ## Documentation For Models @@ -128,6 +128,7 @@ Class | Method | HTTP request | Description - [ConditionalOperator](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/ConditionalOperator.md) - [ConnectionString](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/ConnectionString.md) - [EndpointAgent](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EndpointAgent.md) + - [EndpointAgentEthernetProfile](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentEthernetProfile.md) - [EndpointAgentLocation](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentLocation.md) - [EndpointAgentUpdate](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentUpdate.md) - [EndpointAgents](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EndpointAgents.md) @@ -137,8 +138,7 @@ Class | Method | HTTP request | Description - [EndpointUserProfile](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EndpointUserProfile.md) - [EndpointVpnProfile](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EndpointVpnProfile.md) - [Error](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/Error.md) - - [EthernetProfile](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/EthernetProfile.md) - - [Expand](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/Expand.md) + - [ExpandEndpointAgentOptions](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/ExpandEndpointAgentOptions.md) - [FilterEndpointAgentsResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/FilterEndpointAgentsResponse.md) - [InterfaceHardwareType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/InterfaceHardwareType.md) - [InterfaceProfile](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-agents/docs/InterfaceProfile.md) diff --git a/thousandeyes-sdk-endpoint-agents/docs/AgentTransfer.md b/thousandeyes-sdk-endpoint-agents/docs/AgentTransfer.md index 354fc3d4c..8b42f3427 100644 --- a/thousandeyes-sdk-endpoint-agents/docs/AgentTransfer.md +++ b/thousandeyes-sdk-endpoint-agents/docs/AgentTransfer.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**agent_id** | **str** | Identifier of the agent this applies to. | [optional] [readonly] +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] **from_aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] **to_aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] diff --git a/thousandeyes-sdk-endpoint-agents/docs/EndpointAgent.md b/thousandeyes-sdk-endpoint-agents/docs/EndpointAgent.md index 8fe3a87e7..5b216a9d2 100644 --- a/thousandeyes-sdk-endpoint-agents/docs/EndpointAgent.md +++ b/thousandeyes-sdk-endpoint-agents/docs/EndpointAgent.md @@ -6,7 +6,7 @@ The `EndpointAgent` object, which may include multiple clients. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | Identifier of the agent this applies to. | [optional] [readonly] +**id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] **aid** | **str** | | [optional] **name** | **str** | The name of the agent. | [optional] **computer_name** | **str** | | [optional] [readonly] diff --git a/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentEthernetProfile.md b/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentEthernetProfile.md new file mode 100644 index 000000000..f7f325003 --- /dev/null +++ b/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentEthernetProfile.md @@ -0,0 +1,30 @@ +# EndpointAgentEthernetProfile + +Information about the ethernet connectivity of this device. Only present if the hardware type is `ethernet`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**link_speed** | **int** | Link speed in Mbps. | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_agents.models.endpoint_agent_ethernet_profile import EndpointAgentEthernetProfile + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentEthernetProfile from a JSON string +endpoint_agent_ethernet_profile_instance = EndpointAgentEthernetProfile.from_json(json) +# print the JSON string representation of the object +print(EndpointAgentEthernetProfile.to_json()) + +# convert the object into a dict +endpoint_agent_ethernet_profile_dict = endpoint_agent_ethernet_profile_instance.to_dict() +# create an instance of EndpointAgentEthernetProfile from a dict +endpoint_agent_ethernet_profile_from_dict = EndpointAgentEthernetProfile.from_dict(endpoint_agent_ethernet_profile_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsApi.md b/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsApi.md new file mode 100644 index 000000000..a8d45f6ae --- /dev/null +++ b/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsApi.md @@ -0,0 +1,716 @@ +# thousandeyes_sdk.endpoint_agents.EndpointAgentsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_endpoint_agent**](EndpointAgentsApi.md#delete_endpoint_agent) | **DELETE** /endpoint/agents/{agentId} | Delete endpoint agent +[**disable_endpoint_agent**](EndpointAgentsApi.md#disable_endpoint_agent) | **POST** /endpoint/agents/{agentId}/disable | Disable endpoint agent +[**enable_endpoint_agent**](EndpointAgentsApi.md#enable_endpoint_agent) | **POST** /endpoint/agents/{agentId}/enable | Enable endpoint agent +[**filter_endpoint_agents**](EndpointAgentsApi.md#filter_endpoint_agents) | **POST** /endpoint/agents/filter | Filter endpoint agents +[**get_endpoint_agent**](EndpointAgentsApi.md#get_endpoint_agent) | **GET** /endpoint/agents/{agentId} | Retrieve endpoint agent +[**get_endpoint_agents**](EndpointAgentsApi.md#get_endpoint_agents) | **GET** /endpoint/agents | List endpoint agents +[**get_endpoint_agents_connection_string**](EndpointAgentsApi.md#get_endpoint_agents_connection_string) | **GET** /endpoint/agents/connection-string | Get agent connection string +[**update_endpoint_agent**](EndpointAgentsApi.md#update_endpoint_agent) | **PATCH** /endpoint/agents/{agentId} | Update endpoint agent + + +# **delete_endpoint_agent** +> delete_endpoint_agent(agent_id, aid=aid, expand=expand) + +Delete endpoint agent + +Deletes the agent with the specified `agent_id`. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_agents +from thousandeyes_sdk.endpoint_agents.models.expand_endpoint_agent_options import ExpandEndpointAgentOptions +from thousandeyes_sdk.endpoint_agents.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_agents.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_agents.EndpointAgentsApi(api_client) + agent_id = 'agent_id_example' # str | The identifier of the agent to operate on. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.endpoint_agents.ExpandEndpointAgentOptions()] # List[ExpandEndpointAgentOptions] | This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. (optional) + + try: + # Delete endpoint agent + api_instance.delete_endpoint_agent(agent_id, aid=aid, expand=expand) + except Exception as e: + print("Exception when calling EndpointAgentsApi->delete_endpoint_agent: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_id** | **str**| The identifier of the agent to operate on. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandEndpointAgentOptions]**](ExpandEndpointAgentOptions.md)| This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **disable_endpoint_agent** +> EndpointAgent disable_endpoint_agent(agent_id, aid=aid) + +Disable endpoint agent + +Disables an endpoint agent. If it's already disabled, it has no effect (no operation). + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_agents +from thousandeyes_sdk.endpoint_agents.models.endpoint_agent import EndpointAgent +from thousandeyes_sdk.endpoint_agents.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_agents.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_agents.EndpointAgentsApi(api_client) + agent_id = 'agent_id_example' # str | The identifier of the agent to operate on. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Disable endpoint agent + api_response = api_instance.disable_endpoint_agent(agent_id, aid=aid) + print("The response of EndpointAgentsApi->disable_endpoint_agent:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointAgentsApi->disable_endpoint_agent: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_id** | **str**| The identifier of the agent to operate on. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointAgent**](EndpointAgent.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The agent's current state. | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **enable_endpoint_agent** +> EndpointAgent enable_endpoint_agent(agent_id, aid=aid) + +Enable endpoint agent + +Enables an endpoint agent. If it's already enabled, it has no effect (no operation). + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_agents +from thousandeyes_sdk.endpoint_agents.models.endpoint_agent import EndpointAgent +from thousandeyes_sdk.endpoint_agents.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_agents.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_agents.EndpointAgentsApi(api_client) + agent_id = 'agent_id_example' # str | The identifier of the agent to operate on. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Enable endpoint agent + api_response = api_instance.enable_endpoint_agent(agent_id, aid=aid) + print("The response of EndpointAgentsApi->enable_endpoint_agent:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointAgentsApi->enable_endpoint_agent: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_id** | **str**| The identifier of the agent to operate on. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointAgent**](EndpointAgent.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The agent's current state. | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **filter_endpoint_agents** +> FilterEndpointAgentsResponse filter_endpoint_agents(agent_search_request, max=max, cursor=cursor, aid=aid, expand=expand, include_deleted=include_deleted) + +Filter endpoint agents + +Retrieves a list of endpoint agents within the specified account group that match the specified filters. If no agents meet the filter criteria, the API returns an empty array. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_agents +from thousandeyes_sdk.endpoint_agents.models.agent_search_request import AgentSearchRequest +from thousandeyes_sdk.endpoint_agents.models.expand_endpoint_agent_options import ExpandEndpointAgentOptions +from thousandeyes_sdk.endpoint_agents.models.filter_endpoint_agents_response import FilterEndpointAgentsResponse +from thousandeyes_sdk.endpoint_agents.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_agents.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_agents.EndpointAgentsApi(api_client) + agent_search_request = thousandeyes_sdk.endpoint_agents.AgentSearchRequest() # AgentSearchRequest | The filter options for advanced search filtering for agents. + max = 5 # int | (Optional) Maximum number of objects to return. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.endpoint_agents.ExpandEndpointAgentOptions()] # List[ExpandEndpointAgentOptions] | This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. (optional) + include_deleted = false # bool | When requesting entities, set to `true` if you want to see deleted entities. (optional) + + try: + # Filter endpoint agents + api_response = api_instance.filter_endpoint_agents(agent_search_request, max=max, cursor=cursor, aid=aid, expand=expand, include_deleted=include_deleted) + print("The response of EndpointAgentsApi->filter_endpoint_agents:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointAgentsApi->filter_endpoint_agents: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_search_request** | [**AgentSearchRequest**](AgentSearchRequest.md)| The filter options for advanced search filtering for agents. | + **max** | **int**| (Optional) Maximum number of objects to return. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandEndpointAgentOptions]**](ExpandEndpointAgentOptions.md)| This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. | [optional] + **include_deleted** | **bool**| When requesting entities, set to `true` if you want to see deleted entities. | [optional] + +### Return type + +[**FilterEndpointAgentsResponse**](FilterEndpointAgentsResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_endpoint_agent** +> EndpointAgent get_endpoint_agent(agent_id, aid=aid, expand=expand, include_deleted=include_deleted) + +Retrieve endpoint agent + +Retrieves details of an agent with the specified `agent_id`. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_agents +from thousandeyes_sdk.endpoint_agents.models.endpoint_agent import EndpointAgent +from thousandeyes_sdk.endpoint_agents.models.expand_endpoint_agent_options import ExpandEndpointAgentOptions +from thousandeyes_sdk.endpoint_agents.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_agents.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_agents.EndpointAgentsApi(api_client) + agent_id = 'agent_id_example' # str | The identifier of the agent to operate on. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.endpoint_agents.ExpandEndpointAgentOptions()] # List[ExpandEndpointAgentOptions] | This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. (optional) + include_deleted = false # bool | When requesting entities, set to `true` if you want to see deleted entities. (optional) + + try: + # Retrieve endpoint agent + api_response = api_instance.get_endpoint_agent(agent_id, aid=aid, expand=expand, include_deleted=include_deleted) + print("The response of EndpointAgentsApi->get_endpoint_agent:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointAgentsApi->get_endpoint_agent: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_id** | **str**| The identifier of the agent to operate on. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandEndpointAgentOptions]**](ExpandEndpointAgentOptions.md)| This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. | [optional] + **include_deleted** | **bool**| When requesting entities, set to `true` if you want to see deleted entities. | [optional] + +### Return type + +[**EndpointAgent**](EndpointAgent.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The agent's current state. | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_endpoint_agents** +> ListEndpointAgentsResponse get_endpoint_agents(max=max, cursor=cursor, aid=aid, expand=expand, include_deleted=include_deleted, use_all_permitted_aids=use_all_permitted_aids, agent_name=agent_name, computer_name=computer_name) + +List endpoint agents + +Retrieves a list of endpoint agents in a given account group. If there are no agents in the specified account group, it returns an empty array. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_agents +from thousandeyes_sdk.endpoint_agents.models.expand_endpoint_agent_options import ExpandEndpointAgentOptions +from thousandeyes_sdk.endpoint_agents.models.list_endpoint_agents_response import ListEndpointAgentsResponse +from thousandeyes_sdk.endpoint_agents.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_agents.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_agents.EndpointAgentsApi(api_client) + max = 5 # int | (Optional) Maximum number of objects to return. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.endpoint_agents.ExpandEndpointAgentOptions()] # List[ExpandEndpointAgentOptions] | This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. (optional) + include_deleted = false # bool | When requesting entities, set to `true` if you want to see deleted entities. (optional) + use_all_permitted_aids = False # bool | Set to `true` to load data from all accounts the user has access to. (optional) (default to False) + agent_name = 'agent_name_example' # str | Returns only agents with the specified name. This is an exact match only. (optional) + computer_name = 'computer_name_example' # str | Returns only agents with the specified computer name. This is an exact match only. (optional) + + try: + # List endpoint agents + api_response = api_instance.get_endpoint_agents(max=max, cursor=cursor, aid=aid, expand=expand, include_deleted=include_deleted, use_all_permitted_aids=use_all_permitted_aids, agent_name=agent_name, computer_name=computer_name) + print("The response of EndpointAgentsApi->get_endpoint_agents:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointAgentsApi->get_endpoint_agents: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **max** | **int**| (Optional) Maximum number of objects to return. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandEndpointAgentOptions]**](ExpandEndpointAgentOptions.md)| This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. | [optional] + **include_deleted** | **bool**| When requesting entities, set to `true` if you want to see deleted entities. | [optional] + **use_all_permitted_aids** | **bool**| Set to `true` to load data from all accounts the user has access to. | [optional] [default to False] + **agent_name** | **str**| Returns only agents with the specified name. This is an exact match only. | [optional] + **computer_name** | **str**| Returns only agents with the specified computer name. This is an exact match only. | [optional] + +### Return type + +[**ListEndpointAgentsResponse**](ListEndpointAgentsResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_endpoint_agents_connection_string** +> ConnectionString get_endpoint_agents_connection_string(aid=aid) + +Get agent connection string + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_agents +from thousandeyes_sdk.endpoint_agents.models.connection_string import ConnectionString +from thousandeyes_sdk.endpoint_agents.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_agents.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_agents.EndpointAgentsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Get agent connection string + api_response = api_instance.get_endpoint_agents_connection_string(aid=aid) + print("The response of EndpointAgentsApi->get_endpoint_agents_connection_string:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointAgentsApi->get_endpoint_agents_connection_string: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ConnectionString**](ConnectionString.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_endpoint_agent** +> EndpointAgent update_endpoint_agent(agent_id, aid=aid, expand=expand, endpoint_agent_update=endpoint_agent_update) + +Update endpoint agent + +Updates the agent with the specified `agent_id`. This API supports the modification of the following fields: * `name` * `licenseType` Any attempt to update fields other than those listed above, with a value different from their current value, will result in a 400 Bad Request response. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_agents +from thousandeyes_sdk.endpoint_agents.models.endpoint_agent import EndpointAgent +from thousandeyes_sdk.endpoint_agents.models.endpoint_agent_update import EndpointAgentUpdate +from thousandeyes_sdk.endpoint_agents.models.expand_endpoint_agent_options import ExpandEndpointAgentOptions +from thousandeyes_sdk.endpoint_agents.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_agents.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_agents.EndpointAgentsApi(api_client) + agent_id = 'agent_id_example' # str | The identifier of the agent to operate on. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.endpoint_agents.ExpandEndpointAgentOptions()] # List[ExpandEndpointAgentOptions] | This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. (optional) + endpoint_agent_update = thousandeyes_sdk.endpoint_agents.EndpointAgentUpdate() # EndpointAgentUpdate | Fields to modify on the agent (optional) + + try: + # Update endpoint agent + api_response = api_instance.update_endpoint_agent(agent_id, aid=aid, expand=expand, endpoint_agent_update=endpoint_agent_update) + print("The response of EndpointAgentsApi->update_endpoint_agent:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointAgentsApi->update_endpoint_agent: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_id** | **str**| The identifier of the agent to operate on. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandEndpointAgentOptions]**](ExpandEndpointAgentOptions.md)| This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. | [optional] + **endpoint_agent_update** | [**EndpointAgentUpdate**](EndpointAgentUpdate.md)| Fields to modify on the agent | [optional] + +### Return type + +[**EndpointAgent**](EndpointAgent.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The agent's current state. | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsTransferApi.md b/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsTransferApi.md new file mode 100644 index 000000000..f9f46d3a2 --- /dev/null +++ b/thousandeyes-sdk-endpoint-agents/docs/EndpointAgentsTransferApi.md @@ -0,0 +1,180 @@ +# thousandeyes_sdk.endpoint_agents.EndpointAgentsTransferApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**transfer_endpoint_agent**](EndpointAgentsTransferApi.md#transfer_endpoint_agent) | **POST** /endpoint/agents/{agentId}/transfer | Transfer endpoint agent +[**transfer_endpoint_agents**](EndpointAgentsTransferApi.md#transfer_endpoint_agents) | **POST** /endpoint/agents/transfer/bulk | Bulk transfer agents + + +# **transfer_endpoint_agent** +> transfer_endpoint_agent(agent_id, agent_transfer_request, aid=aid) + +Transfer endpoint agent + +Initiates the transfer of an agent from its current account, which must correspond to the provided aid, to the target account. **Note:** It is essential to ensure that the `aid` parameter matches the current account of the agent for this operation to succeed. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_agents +from thousandeyes_sdk.endpoint_agents.models.agent_transfer_request import AgentTransferRequest +from thousandeyes_sdk.endpoint_agents.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_agents.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_agents.EndpointAgentsTransferApi(api_client) + agent_id = 'agent_id_example' # str | The identifier of the agent to operate on. + agent_transfer_request = thousandeyes_sdk.endpoint_agents.AgentTransferRequest() # AgentTransferRequest | The request to move an agent between accounts. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Transfer endpoint agent + api_instance.transfer_endpoint_agent(agent_id, agent_transfer_request, aid=aid) + except Exception as e: + print("Exception when calling EndpointAgentsTransferApi->transfer_endpoint_agent: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_id** | **str**| The identifier of the agent to operate on. | + **agent_transfer_request** | [**AgentTransferRequest**](AgentTransferRequest.md)| The request to move an agent between accounts. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Transfer initiated | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **transfer_endpoint_agents** +> BulkAgentTransferResponse transfer_endpoint_agents(aid=aid, bulk_agent_transfer_request=bulk_agent_transfer_request) + +Bulk transfer agents + +Initiates the transfer of multiple agents between accounts. The following conditions apply: * The requester must possess 'write' permissions for both the 'from' and 'to' accounts involved in each transfer. * Multiple transfers may involve a mix of different source and destination accounts. * For each transfer request, the 'from' account must match the current account of the respective agent. * Transfers are executed asynchronously. * Progress tracking is not intended, but users can monitor the progress by periodically polling the 'get agent' endpoint. * Each transfer request is individually validated and completed; this operation is not atomic, meaning transfers can succeed or fail individually. * The API response provides the status of each transfer request. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_agents +from thousandeyes_sdk.endpoint_agents.models.bulk_agent_transfer_request import BulkAgentTransferRequest +from thousandeyes_sdk.endpoint_agents.models.bulk_agent_transfer_response import BulkAgentTransferResponse +from thousandeyes_sdk.endpoint_agents.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_agents.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_agents.EndpointAgentsTransferApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + bulk_agent_transfer_request = thousandeyes_sdk.endpoint_agents.BulkAgentTransferRequest() # BulkAgentTransferRequest | A collection of `AgentTransfers`. (optional) + + try: + # Bulk transfer agents + api_response = api_instance.transfer_endpoint_agents(aid=aid, bulk_agent_transfer_request=bulk_agent_transfer_request) + print("The response of EndpointAgentsTransferApi->transfer_endpoint_agents:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointAgentsTransferApi->transfer_endpoint_agents: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **bulk_agent_transfer_request** | [**BulkAgentTransferRequest**](BulkAgentTransferRequest.md)| A collection of `AgentTransfers`. | [optional] + +### Return type + +[**BulkAgentTransferResponse**](BulkAgentTransferResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json, text/csv, text/plain + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**207** | Transfer initiated | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-endpoint-agents/docs/ExpandEndpointAgentOptions.md b/thousandeyes-sdk-endpoint-agents/docs/ExpandEndpointAgentOptions.md new file mode 100644 index 000000000..63b0be535 --- /dev/null +++ b/thousandeyes-sdk-endpoint-agents/docs/ExpandEndpointAgentOptions.md @@ -0,0 +1,11 @@ +# ExpandEndpointAgentOptions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-agents/docs/InterfaceProfile.md b/thousandeyes-sdk-endpoint-agents/docs/InterfaceProfile.md index cf5ac403b..7f7bdcaf5 100644 --- a/thousandeyes-sdk-endpoint-agents/docs/InterfaceProfile.md +++ b/thousandeyes-sdk-endpoint-agents/docs/InterfaceProfile.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **interface_name** | **str** | | [optional] **address_profiles** | [**List[AddressProfile]**](AddressProfile.md) | | [optional] **hardware_type** | [**InterfaceHardwareType**](InterfaceHardwareType.md) | | [optional] -**ethernet_profile** | [**EthernetProfile**](EthernetProfile.md) | | [optional] +**ethernet_profile** | [**EndpointAgentEthernetProfile**](EndpointAgentEthernetProfile.md) | | [optional] **wireless_profile** | [**WirelessProfile**](WirelessProfile.md) | | [optional] ## Example diff --git a/thousandeyes-sdk-endpoint-agents/docs/Platform.md b/thousandeyes-sdk-endpoint-agents/docs/Platform.md index 97f29ba74..df59b607c 100644 --- a/thousandeyes-sdk-endpoint-agents/docs/Platform.md +++ b/thousandeyes-sdk-endpoint-agents/docs/Platform.md @@ -1,6 +1,6 @@ # Platform -OS platform types +OS platform types. Platform \"linux\" was recently renamed to \"roomos\". ## Properties diff --git a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/__init__.py b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/__init__.py index f11e4a8e4..0a77f9ec2 100644 --- a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/__init__.py +++ b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/__init__.py @@ -14,9 +14,8 @@ # import apis into sdk package -from thousandeyes_sdk.endpoint_agents.api.administrative_endpoints_api import AdministrativeEndpointsApi -from thousandeyes_sdk.endpoint_agents.api.manage_agents_api import ManageAgentsApi -from thousandeyes_sdk.endpoint_agents.api.transfer_api import TransferApi +from thousandeyes_sdk.endpoint_agents.api.endpoint_agents_api import EndpointAgentsApi +from thousandeyes_sdk.endpoint_agents.api.endpoint_agents_transfer_api import EndpointAgentsTransferApi # import models into sdk package @@ -38,6 +37,7 @@ from thousandeyes_sdk.endpoint_agents.models.conditional_operator import ConditionalOperator from thousandeyes_sdk.endpoint_agents.models.connection_string import ConnectionString from thousandeyes_sdk.endpoint_agents.models.endpoint_agent import EndpointAgent +from thousandeyes_sdk.endpoint_agents.models.endpoint_agent_ethernet_profile import EndpointAgentEthernetProfile from thousandeyes_sdk.endpoint_agents.models.endpoint_agent_location import EndpointAgentLocation from thousandeyes_sdk.endpoint_agents.models.endpoint_agent_update import EndpointAgentUpdate from thousandeyes_sdk.endpoint_agents.models.endpoint_agents import EndpointAgents @@ -47,8 +47,7 @@ from thousandeyes_sdk.endpoint_agents.models.endpoint_user_profile import EndpointUserProfile from thousandeyes_sdk.endpoint_agents.models.endpoint_vpn_profile import EndpointVpnProfile from thousandeyes_sdk.endpoint_agents.models.error import Error -from thousandeyes_sdk.endpoint_agents.models.ethernet_profile import EthernetProfile -from thousandeyes_sdk.endpoint_agents.models.expand import Expand +from thousandeyes_sdk.endpoint_agents.models.expand_endpoint_agent_options import ExpandEndpointAgentOptions from thousandeyes_sdk.endpoint_agents.models.filter_endpoint_agents_response import FilterEndpointAgentsResponse from thousandeyes_sdk.endpoint_agents.models.interface_hardware_type import InterfaceHardwareType from thousandeyes_sdk.endpoint_agents.models.interface_profile import InterfaceProfile diff --git a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/api/__init__.py b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/api/__init__.py index d74eb6070..f63ec8bb4 100644 --- a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/api/__init__.py +++ b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/api/__init__.py @@ -1,7 +1,6 @@ # flake8: noqa # import apis into api package -from thousandeyes_sdk.endpoint_agents.api.administrative_endpoints_api import AdministrativeEndpointsApi -from thousandeyes_sdk.endpoint_agents.api.manage_agents_api import ManageAgentsApi -from thousandeyes_sdk.endpoint_agents.api.transfer_api import TransferApi +from thousandeyes_sdk.endpoint_agents.api.endpoint_agents_api import EndpointAgentsApi +from thousandeyes_sdk.endpoint_agents.api.endpoint_agents_transfer_api import EndpointAgentsTransferApi diff --git a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/api/endpoint_agents_api.py b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/api/endpoint_agents_api.py new file mode 100644 index 000000000..1569eae7e --- /dev/null +++ b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/api/endpoint_agents_api.py @@ -0,0 +1,2637 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. For more information about Endpoint Agents, see [Endpoint Agents](https://docs.thousandeyes.com/product-documentation/global-vantage-points/endpoint-agents). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.endpoint_agents.models + +from pydantic import Field, StrictBool, StrictInt, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.endpoint_agents.models.agent_search_request import AgentSearchRequest +from thousandeyes_sdk.endpoint_agents.models.connection_string import ConnectionString +from thousandeyes_sdk.endpoint_agents.models.endpoint_agent import EndpointAgent +from thousandeyes_sdk.endpoint_agents.models.endpoint_agent_update import EndpointAgentUpdate +from thousandeyes_sdk.endpoint_agents.models.expand_endpoint_agent_options import ExpandEndpointAgentOptions +from thousandeyes_sdk.endpoint_agents.models.filter_endpoint_agents_response import FilterEndpointAgentsResponse +from thousandeyes_sdk.endpoint_agents.models.list_endpoint_agents_response import ListEndpointAgentsResponse + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class EndpointAgentsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-endpoint-agents")) + self.api_client = api_client + + + @validate_call + def delete_endpoint_agent( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandEndpointAgentOptions]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete endpoint agent + + Deletes the agent with the specified `agent_id`. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[ExpandEndpointAgentOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_endpoint_agent_serialize( + agent_id=agent_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ).data + + + @validate_call + def delete_endpoint_agent_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandEndpointAgentOptions]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete endpoint agent + + Deletes the agent with the specified `agent_id`. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[ExpandEndpointAgentOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_endpoint_agent_serialize( + agent_id=agent_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ) + + + @validate_call + def delete_endpoint_agent_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandEndpointAgentOptions]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete endpoint agent + + Deletes the agent with the specified `agent_id`. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[ExpandEndpointAgentOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_endpoint_agent_serialize( + agent_id=agent_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_endpoint_agent_serialize( + self, + agent_id, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if agent_id is not None: + _path_params['agentId'] = agent_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/endpoint/agents/{agentId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def disable_endpoint_agent( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EndpointAgent: + """Disable endpoint agent + + Disables an endpoint agent. If it's already disabled, it has no effect (no operation). + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._disable_endpoint_agent_serialize( + agent_id=agent_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgent", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ).data + + + @validate_call + def disable_endpoint_agent_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EndpointAgent]: + """Disable endpoint agent + + Disables an endpoint agent. If it's already disabled, it has no effect (no operation). + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._disable_endpoint_agent_serialize( + agent_id=agent_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgent", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ) + + + @validate_call + def disable_endpoint_agent_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Disable endpoint agent + + Disables an endpoint agent. If it's already disabled, it has no effect (no operation). + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._disable_endpoint_agent_serialize( + agent_id=agent_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgent", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _disable_endpoint_agent_serialize( + self, + agent_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if agent_id is not None: + _path_params['agentId'] = agent_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/agents/{agentId}/disable', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def enable_endpoint_agent( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EndpointAgent: + """Enable endpoint agent + + Enables an endpoint agent. If it's already enabled, it has no effect (no operation). + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._enable_endpoint_agent_serialize( + agent_id=agent_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgent", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ).data + + + @validate_call + def enable_endpoint_agent_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EndpointAgent]: + """Enable endpoint agent + + Enables an endpoint agent. If it's already enabled, it has no effect (no operation). + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._enable_endpoint_agent_serialize( + agent_id=agent_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgent", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ) + + + @validate_call + def enable_endpoint_agent_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Enable endpoint agent + + Enables an endpoint agent. If it's already enabled, it has no effect (no operation). + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._enable_endpoint_agent_serialize( + agent_id=agent_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgent", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _enable_endpoint_agent_serialize( + self, + agent_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if agent_id is not None: + _path_params['agentId'] = agent_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/agents/{agentId}/enable', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def filter_endpoint_agents( + self, + agent_search_request: Annotated[AgentSearchRequest, Field(description="The filter options for advanced search filtering for agents.")], + max: Annotated[Optional[StrictInt], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandEndpointAgentOptions]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FilterEndpointAgentsResponse: + """Filter endpoint agents + + Retrieves a list of endpoint agents within the specified account group that match the specified filters. If no agents meet the filter criteria, the API returns an empty array. + + :param agent_search_request: The filter options for advanced search filtering for agents. (required) + :type agent_search_request: AgentSearchRequest + :param max: (Optional) Maximum number of objects to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[ExpandEndpointAgentOptions] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_endpoint_agents_serialize( + agent_search_request=agent_search_request, + max=max, + cursor=cursor, + aid=aid, + expand=expand, + include_deleted=include_deleted, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FilterEndpointAgentsResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ).data + + + @validate_call + def filter_endpoint_agents_with_http_info( + self, + agent_search_request: Annotated[AgentSearchRequest, Field(description="The filter options for advanced search filtering for agents.")], + max: Annotated[Optional[StrictInt], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandEndpointAgentOptions]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FilterEndpointAgentsResponse]: + """Filter endpoint agents + + Retrieves a list of endpoint agents within the specified account group that match the specified filters. If no agents meet the filter criteria, the API returns an empty array. + + :param agent_search_request: The filter options for advanced search filtering for agents. (required) + :type agent_search_request: AgentSearchRequest + :param max: (Optional) Maximum number of objects to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[ExpandEndpointAgentOptions] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_endpoint_agents_serialize( + agent_search_request=agent_search_request, + max=max, + cursor=cursor, + aid=aid, + expand=expand, + include_deleted=include_deleted, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FilterEndpointAgentsResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ) + + + @validate_call + def filter_endpoint_agents_without_preload_content( + self, + agent_search_request: Annotated[AgentSearchRequest, Field(description="The filter options for advanced search filtering for agents.")], + max: Annotated[Optional[StrictInt], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandEndpointAgentOptions]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Filter endpoint agents + + Retrieves a list of endpoint agents within the specified account group that match the specified filters. If no agents meet the filter criteria, the API returns an empty array. + + :param agent_search_request: The filter options for advanced search filtering for agents. (required) + :type agent_search_request: AgentSearchRequest + :param max: (Optional) Maximum number of objects to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[ExpandEndpointAgentOptions] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_endpoint_agents_serialize( + agent_search_request=agent_search_request, + max=max, + cursor=cursor, + aid=aid, + expand=expand, + include_deleted=include_deleted, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FilterEndpointAgentsResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _filter_endpoint_agents_serialize( + self, + agent_search_request, + max, + cursor, + aid, + expand, + include_deleted, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if max is not None: + + _query_params.append(('max', max)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if include_deleted is not None: + + _query_params.append(('includeDeleted', include_deleted)) + + # process the header parameters + # process the form parameters + # process the body parameter + if agent_search_request is not None: + _body_params = agent_search_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/agents/filter', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_endpoint_agent( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandEndpointAgentOptions]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EndpointAgent: + """Retrieve endpoint agent + + Retrieves details of an agent with the specified `agent_id`. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[ExpandEndpointAgentOptions] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_agent_serialize( + agent_id=agent_id, + aid=aid, + expand=expand, + include_deleted=include_deleted, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgent", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ).data + + + @validate_call + def get_endpoint_agent_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandEndpointAgentOptions]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EndpointAgent]: + """Retrieve endpoint agent + + Retrieves details of an agent with the specified `agent_id`. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[ExpandEndpointAgentOptions] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_agent_serialize( + agent_id=agent_id, + aid=aid, + expand=expand, + include_deleted=include_deleted, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgent", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ) + + + @validate_call + def get_endpoint_agent_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandEndpointAgentOptions]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve endpoint agent + + Retrieves details of an agent with the specified `agent_id`. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[ExpandEndpointAgentOptions] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_agent_serialize( + agent_id=agent_id, + aid=aid, + expand=expand, + include_deleted=include_deleted, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgent", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_endpoint_agent_serialize( + self, + agent_id, + aid, + expand, + include_deleted, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if agent_id is not None: + _path_params['agentId'] = agent_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if include_deleted is not None: + + _query_params.append(('includeDeleted', include_deleted)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/agents/{agentId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_endpoint_agents( + self, + max: Annotated[Optional[StrictInt], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandEndpointAgentOptions]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = None, + use_all_permitted_aids: Annotated[Optional[StrictBool], Field(description="Set to `true` to load data from all accounts the user has access to.")] = None, + agent_name: Annotated[Optional[StrictStr], Field(description="Returns only agents with the specified name. This is an exact match only. ")] = None, + computer_name: Annotated[Optional[StrictStr], Field(description="Returns only agents with the specified computer name. This is an exact match only. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListEndpointAgentsResponse: + """List endpoint agents + + Retrieves a list of endpoint agents in a given account group. If there are no agents in the specified account group, it returns an empty array. + + :param max: (Optional) Maximum number of objects to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[ExpandEndpointAgentOptions] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :param use_all_permitted_aids: Set to `true` to load data from all accounts the user has access to. + :type use_all_permitted_aids: bool + :param agent_name: Returns only agents with the specified name. This is an exact match only. + :type agent_name: str + :param computer_name: Returns only agents with the specified computer name. This is an exact match only. + :type computer_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_agents_serialize( + max=max, + cursor=cursor, + aid=aid, + expand=expand, + include_deleted=include_deleted, + use_all_permitted_aids=use_all_permitted_aids, + agent_name=agent_name, + computer_name=computer_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListEndpointAgentsResponse", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ).data + + + @validate_call + def get_endpoint_agents_with_http_info( + self, + max: Annotated[Optional[StrictInt], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandEndpointAgentOptions]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = None, + use_all_permitted_aids: Annotated[Optional[StrictBool], Field(description="Set to `true` to load data from all accounts the user has access to.")] = None, + agent_name: Annotated[Optional[StrictStr], Field(description="Returns only agents with the specified name. This is an exact match only. ")] = None, + computer_name: Annotated[Optional[StrictStr], Field(description="Returns only agents with the specified computer name. This is an exact match only. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListEndpointAgentsResponse]: + """List endpoint agents + + Retrieves a list of endpoint agents in a given account group. If there are no agents in the specified account group, it returns an empty array. + + :param max: (Optional) Maximum number of objects to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[ExpandEndpointAgentOptions] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :param use_all_permitted_aids: Set to `true` to load data from all accounts the user has access to. + :type use_all_permitted_aids: bool + :param agent_name: Returns only agents with the specified name. This is an exact match only. + :type agent_name: str + :param computer_name: Returns only agents with the specified computer name. This is an exact match only. + :type computer_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_agents_serialize( + max=max, + cursor=cursor, + aid=aid, + expand=expand, + include_deleted=include_deleted, + use_all_permitted_aids=use_all_permitted_aids, + agent_name=agent_name, + computer_name=computer_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListEndpointAgentsResponse", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ) + + + @validate_call + def get_endpoint_agents_without_preload_content( + self, + max: Annotated[Optional[StrictInt], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandEndpointAgentOptions]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + include_deleted: Annotated[Optional[StrictBool], Field(description="When requesting entities, set to `true` if you want to see deleted entities.")] = None, + use_all_permitted_aids: Annotated[Optional[StrictBool], Field(description="Set to `true` to load data from all accounts the user has access to.")] = None, + agent_name: Annotated[Optional[StrictStr], Field(description="Returns only agents with the specified name. This is an exact match only. ")] = None, + computer_name: Annotated[Optional[StrictStr], Field(description="Returns only agents with the specified computer name. This is an exact match only. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List endpoint agents + + Retrieves a list of endpoint agents in a given account group. If there are no agents in the specified account group, it returns an empty array. + + :param max: (Optional) Maximum number of objects to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[ExpandEndpointAgentOptions] + :param include_deleted: When requesting entities, set to `true` if you want to see deleted entities. + :type include_deleted: bool + :param use_all_permitted_aids: Set to `true` to load data from all accounts the user has access to. + :type use_all_permitted_aids: bool + :param agent_name: Returns only agents with the specified name. This is an exact match only. + :type agent_name: str + :param computer_name: Returns only agents with the specified computer name. This is an exact match only. + :type computer_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_agents_serialize( + max=max, + cursor=cursor, + aid=aid, + expand=expand, + include_deleted=include_deleted, + use_all_permitted_aids=use_all_permitted_aids, + agent_name=agent_name, + computer_name=computer_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListEndpointAgentsResponse", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_endpoint_agents_serialize( + self, + max, + cursor, + aid, + expand, + include_deleted, + use_all_permitted_aids, + agent_name, + computer_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if max is not None: + + _query_params.append(('max', max)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if include_deleted is not None: + + _query_params.append(('includeDeleted', include_deleted)) + + if use_all_permitted_aids is not None: + + _query_params.append(('useAllPermittedAids', use_all_permitted_aids)) + + if agent_name is not None: + + _query_params.append(('agentName', agent_name)) + + if computer_name is not None: + + _query_params.append(('computerName', computer_name)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/agents', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_endpoint_agents_connection_string( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConnectionString: + """Get agent connection string + + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_agents_connection_string_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectionString", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ).data + + + @validate_call + def get_endpoint_agents_connection_string_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ConnectionString]: + """Get agent connection string + + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_agents_connection_string_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectionString", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ) + + + @validate_call + def get_endpoint_agents_connection_string_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get agent connection string + + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_agents_connection_string_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectionString", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_endpoint_agents_connection_string_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/agents/connection-string', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_endpoint_agent( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandEndpointAgentOptions]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + endpoint_agent_update: Annotated[Optional[EndpointAgentUpdate], Field(description="Fields to modify on the agent")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EndpointAgent: + """Update endpoint agent + + Updates the agent with the specified `agent_id`. This API supports the modification of the following fields: * `name` * `licenseType` Any attempt to update fields other than those listed above, with a value different from their current value, will result in a 400 Bad Request response. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[ExpandEndpointAgentOptions] + :param endpoint_agent_update: Fields to modify on the agent + :type endpoint_agent_update: EndpointAgentUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_endpoint_agent_serialize( + agent_id=agent_id, + aid=aid, + expand=expand, + endpoint_agent_update=endpoint_agent_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgent", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ).data + + + @validate_call + def update_endpoint_agent_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandEndpointAgentOptions]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + endpoint_agent_update: Annotated[Optional[EndpointAgentUpdate], Field(description="Fields to modify on the agent")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EndpointAgent]: + """Update endpoint agent + + Updates the agent with the specified `agent_id`. This API supports the modification of the following fields: * `name` * `licenseType` Any attempt to update fields other than those listed above, with a value different from their current value, will result in a 400 Bad Request response. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[ExpandEndpointAgentOptions] + :param endpoint_agent_update: Fields to modify on the agent + :type endpoint_agent_update: EndpointAgentUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_endpoint_agent_serialize( + agent_id=agent_id, + aid=aid, + expand=expand, + endpoint_agent_update=endpoint_agent_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgent", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ) + + + @validate_call + def update_endpoint_agent_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandEndpointAgentOptions]], Field(description="This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. ")] = None, + endpoint_agent_update: Annotated[Optional[EndpointAgentUpdate], Field(description="Fields to modify on the agent")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update endpoint agent + + Updates the agent with the specified `agent_id`. This API supports the modification of the following fields: * `name` * `licenseType` Any attempt to update fields other than those listed above, with a value different from their current value, will result in a 400 Bad Request response. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: This optional parameter allows you to control the expansion of test resources associated with the agent. By default, no expansion occurs when this query parameter is omitted. To expand the \"clients\" resource, include the query parameter `?expand=clients`. For multiple expansions, you have two options: * Separate the values with commas. For example, `?expandAgent=clients,tasks`. * Specify the parameter multiple times. For example, `?expandAgent=clients&expandAgent=tasks`. This parameter offers flexibility for users to customize the expansion of specific resources related to the agent. + :type expand: List[ExpandEndpointAgentOptions] + :param endpoint_agent_update: Fields to modify on the agent + :type endpoint_agent_update: EndpointAgentUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_endpoint_agent_serialize( + agent_id=agent_id, + aid=aid, + expand=expand, + endpoint_agent_update=endpoint_agent_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgent", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_endpoint_agent_serialize( + self, + agent_id, + aid, + expand, + endpoint_agent_update, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if agent_id is not None: + _path_params['agentId'] = agent_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if endpoint_agent_update is not None: + _body_params = endpoint_agent_update + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/endpoint/agents/{agentId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/api/endpoint_agents_transfer_api.py b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/api/endpoint_agents_transfer_api.py new file mode 100644 index 000000000..e93699664 --- /dev/null +++ b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/api/endpoint_agents_transfer_api.py @@ -0,0 +1,671 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. For more information about Endpoint Agents, see [Endpoint Agents](https://docs.thousandeyes.com/product-documentation/global-vantage-points/endpoint-agents). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.endpoint_agents.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.endpoint_agents.models.agent_transfer_request import AgentTransferRequest +from thousandeyes_sdk.endpoint_agents.models.bulk_agent_transfer_request import BulkAgentTransferRequest +from thousandeyes_sdk.endpoint_agents.models.bulk_agent_transfer_response import BulkAgentTransferResponse + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class EndpointAgentsTransferApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-endpoint-agents")) + self.api_client = api_client + + + @validate_call + def transfer_endpoint_agent( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + agent_transfer_request: Annotated[AgentTransferRequest, Field(description="The request to move an agent between accounts.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Transfer endpoint agent + + Initiates the transfer of an agent from its current account, which must correspond to the provided aid, to the target account. **Note:** It is essential to ensure that the `aid` parameter matches the current account of the agent for this operation to succeed. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param agent_transfer_request: The request to move an agent between accounts. (required) + :type agent_transfer_request: AgentTransferRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._transfer_endpoint_agent_serialize( + agent_id=agent_id, + agent_transfer_request=agent_transfer_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ).data + + + @validate_call + def transfer_endpoint_agent_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + agent_transfer_request: Annotated[AgentTransferRequest, Field(description="The request to move an agent between accounts.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Transfer endpoint agent + + Initiates the transfer of an agent from its current account, which must correspond to the provided aid, to the target account. **Note:** It is essential to ensure that the `aid` parameter matches the current account of the agent for this operation to succeed. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param agent_transfer_request: The request to move an agent between accounts. (required) + :type agent_transfer_request: AgentTransferRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._transfer_endpoint_agent_serialize( + agent_id=agent_id, + agent_transfer_request=agent_transfer_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ) + + + @validate_call + def transfer_endpoint_agent_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="The identifier of the agent to operate on.")], + agent_transfer_request: Annotated[AgentTransferRequest, Field(description="The request to move an agent between accounts.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Transfer endpoint agent + + Initiates the transfer of an agent from its current account, which must correspond to the provided aid, to the target account. **Note:** It is essential to ensure that the `aid` parameter matches the current account of the agent for this operation to succeed. + + :param agent_id: The identifier of the agent to operate on. (required) + :type agent_id: str + :param agent_transfer_request: The request to move an agent between accounts. (required) + :type agent_transfer_request: AgentTransferRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._transfer_endpoint_agent_serialize( + agent_id=agent_id, + agent_transfer_request=agent_transfer_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _transfer_endpoint_agent_serialize( + self, + agent_id, + agent_transfer_request, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if agent_id is not None: + _path_params['agentId'] = agent_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if agent_transfer_request is not None: + _body_params = agent_transfer_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/agents/{agentId}/transfer', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def transfer_endpoint_agents( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + bulk_agent_transfer_request: Annotated[Optional[BulkAgentTransferRequest], Field(description="A collection of `AgentTransfers`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BulkAgentTransferResponse: + """Bulk transfer agents + + Initiates the transfer of multiple agents between accounts. The following conditions apply: * The requester must possess 'write' permissions for both the 'from' and 'to' accounts involved in each transfer. * Multiple transfers may involve a mix of different source and destination accounts. * For each transfer request, the 'from' account must match the current account of the respective agent. * Transfers are executed asynchronously. * Progress tracking is not intended, but users can monitor the progress by periodically polling the 'get agent' endpoint. * Each transfer request is individually validated and completed; this operation is not atomic, meaning transfers can succeed or fail individually. * The API response provides the status of each transfer request. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param bulk_agent_transfer_request: A collection of `AgentTransfers`. + :type bulk_agent_transfer_request: BulkAgentTransferRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._transfer_endpoint_agents_serialize( + aid=aid, + bulk_agent_transfer_request=bulk_agent_transfer_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '207': "BulkAgentTransferResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ).data + + + @validate_call + def transfer_endpoint_agents_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + bulk_agent_transfer_request: Annotated[Optional[BulkAgentTransferRequest], Field(description="A collection of `AgentTransfers`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BulkAgentTransferResponse]: + """Bulk transfer agents + + Initiates the transfer of multiple agents between accounts. The following conditions apply: * The requester must possess 'write' permissions for both the 'from' and 'to' accounts involved in each transfer. * Multiple transfers may involve a mix of different source and destination accounts. * For each transfer request, the 'from' account must match the current account of the respective agent. * Transfers are executed asynchronously. * Progress tracking is not intended, but users can monitor the progress by periodically polling the 'get agent' endpoint. * Each transfer request is individually validated and completed; this operation is not atomic, meaning transfers can succeed or fail individually. * The API response provides the status of each transfer request. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param bulk_agent_transfer_request: A collection of `AgentTransfers`. + :type bulk_agent_transfer_request: BulkAgentTransferRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._transfer_endpoint_agents_serialize( + aid=aid, + bulk_agent_transfer_request=bulk_agent_transfer_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '207': "BulkAgentTransferResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_agents.models, + ) + + + @validate_call + def transfer_endpoint_agents_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + bulk_agent_transfer_request: Annotated[Optional[BulkAgentTransferRequest], Field(description="A collection of `AgentTransfers`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Bulk transfer agents + + Initiates the transfer of multiple agents between accounts. The following conditions apply: * The requester must possess 'write' permissions for both the 'from' and 'to' accounts involved in each transfer. * Multiple transfers may involve a mix of different source and destination accounts. * For each transfer request, the 'from' account must match the current account of the respective agent. * Transfers are executed asynchronously. * Progress tracking is not intended, but users can monitor the progress by periodically polling the 'get agent' endpoint. * Each transfer request is individually validated and completed; this operation is not atomic, meaning transfers can succeed or fail individually. * The API response provides the status of each transfer request. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param bulk_agent_transfer_request: A collection of `AgentTransfers`. + :type bulk_agent_transfer_request: BulkAgentTransferRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._transfer_endpoint_agents_serialize( + aid=aid, + bulk_agent_transfer_request=bulk_agent_transfer_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '207': "BulkAgentTransferResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _transfer_endpoint_agents_serialize( + self, + aid, + bulk_agent_transfer_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if bulk_agent_transfer_request is not None: + _body_params = bulk_agent_transfer_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'text/csv', + 'text/plain' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/agents/transfer/bulk', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/__init__.py b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/__init__.py index 8ad100ddf..fd5118c08 100644 --- a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/__init__.py +++ b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/__init__.py @@ -31,6 +31,7 @@ from thousandeyes_sdk.endpoint_agents.models.conditional_operator import ConditionalOperator from thousandeyes_sdk.endpoint_agents.models.connection_string import ConnectionString from thousandeyes_sdk.endpoint_agents.models.endpoint_agent import EndpointAgent +from thousandeyes_sdk.endpoint_agents.models.endpoint_agent_ethernet_profile import EndpointAgentEthernetProfile from thousandeyes_sdk.endpoint_agents.models.endpoint_agent_location import EndpointAgentLocation from thousandeyes_sdk.endpoint_agents.models.endpoint_agent_update import EndpointAgentUpdate from thousandeyes_sdk.endpoint_agents.models.endpoint_agents import EndpointAgents @@ -40,8 +41,7 @@ from thousandeyes_sdk.endpoint_agents.models.endpoint_user_profile import EndpointUserProfile from thousandeyes_sdk.endpoint_agents.models.endpoint_vpn_profile import EndpointVpnProfile from thousandeyes_sdk.endpoint_agents.models.error import Error -from thousandeyes_sdk.endpoint_agents.models.ethernet_profile import EthernetProfile -from thousandeyes_sdk.endpoint_agents.models.expand import Expand +from thousandeyes_sdk.endpoint_agents.models.expand_endpoint_agent_options import ExpandEndpointAgentOptions from thousandeyes_sdk.endpoint_agents.models.filter_endpoint_agents_response import FilterEndpointAgentsResponse from thousandeyes_sdk.endpoint_agents.models.interface_hardware_type import InterfaceHardwareType from thousandeyes_sdk.endpoint_agents.models.interface_profile import InterfaceProfile diff --git a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/agent_transfer.py b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/agent_transfer.py index 06d636097..11388cb3d 100644 --- a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/agent_transfer.py +++ b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/agent_transfer.py @@ -25,7 +25,7 @@ class AgentTransfer(BaseModel): """ AgentTransfer """ # noqa: E501 - agent_id: Optional[StrictStr] = Field(default=None, description="Identifier of the agent this applies to.", alias="agentId") + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") from_aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.", alias="fromAid") to_aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.", alias="toAid") __properties: ClassVar[List[str]] = ["agentId", "fromAid", "toAid"] diff --git a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/endpoint_agent.py b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/endpoint_agent.py index 5f68a5a6c..526eccaca 100644 --- a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/endpoint_agent.py +++ b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/endpoint_agent.py @@ -35,7 +35,7 @@ class EndpointAgent(BaseModel): """ The `EndpointAgent` object, which may include multiple clients. """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Identifier of the agent this applies to.") + id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.") aid: Optional[Any] = None name: Optional[StrictStr] = Field(default=None, description="The name of the agent.") computer_name: Optional[StrictStr] = Field(default=None, alias="computerName") diff --git a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/endpoint_agent_ethernet_profile.py b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/endpoint_agent_ethernet_profile.py new file mode 100644 index 000000000..fb7eda1f3 --- /dev/null +++ b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/endpoint_agent_ethernet_profile.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. For more information about Endpoint Agents, see [Endpoint Agents](https://docs.thousandeyes.com/product-documentation/global-vantage-points/endpoint-agents). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class EndpointAgentEthernetProfile(BaseModel): + """ + Information about the ethernet connectivity of this device. Only present if the hardware type is `ethernet`. + """ # noqa: E501 + link_speed: Optional[StrictInt] = Field(default=None, description="Link speed in Mbps.", alias="linkSpeed") + __properties: ClassVar[List[str]] = ["linkSpeed"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EndpointAgentEthernetProfile from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EndpointAgentEthernetProfile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "linkSpeed": obj.get("linkSpeed") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/expand_endpoint_agent_options.py b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/expand_endpoint_agent_options.py new file mode 100644 index 000000000..8bcc824d9 --- /dev/null +++ b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/expand_endpoint_agent_options.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. For more information about Endpoint Agents, see [Endpoint Agents](https://docs.thousandeyes.com/product-documentation/global-vantage-points/endpoint-agents). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ExpandEndpointAgentOptions(str, Enum): + """ + ExpandEndpointAgentOptions + """ + + """ + allowed enum values + """ + CLIENTS = 'clients' + VPNPROFILES = 'vpnProfiles' + NETWORKINTERFACEPROFILES = 'networkInterfaceProfiles' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ExpandEndpointAgentOptions from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/interface_profile.py b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/interface_profile.py index 97b1371d1..a077ac017 100644 --- a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/interface_profile.py +++ b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/interface_profile.py @@ -19,7 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from thousandeyes_sdk.endpoint_agents.models.address_profile import AddressProfile -from thousandeyes_sdk.endpoint_agents.models.ethernet_profile import EthernetProfile +from thousandeyes_sdk.endpoint_agents.models.endpoint_agent_ethernet_profile import EndpointAgentEthernetProfile from thousandeyes_sdk.endpoint_agents.models.interface_hardware_type import InterfaceHardwareType from thousandeyes_sdk.endpoint_agents.models.wireless_profile import WirelessProfile from typing import Optional, Set @@ -32,7 +32,7 @@ class InterfaceProfile(BaseModel): interface_name: Optional[StrictStr] = Field(default=None, alias="interfaceName") address_profiles: Optional[List[AddressProfile]] = Field(default=None, alias="addressProfiles") hardware_type: Optional[InterfaceHardwareType] = Field(default=None, alias="hardwareType") - ethernet_profile: Optional[EthernetProfile] = Field(default=None, alias="ethernetProfile") + ethernet_profile: Optional[EndpointAgentEthernetProfile] = Field(default=None, alias="ethernetProfile") wireless_profile: Optional[WirelessProfile] = Field(default=None, alias="wirelessProfile") __properties: ClassVar[List[str]] = ["interfaceName", "addressProfiles", "hardwareType", "ethernetProfile", "wirelessProfile"] @@ -104,7 +104,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "interfaceName": obj.get("interfaceName"), "addressProfiles": [AddressProfile.from_dict(_item) for _item in obj["addressProfiles"]] if obj.get("addressProfiles") is not None else None, "hardwareType": obj.get("hardwareType"), - "ethernetProfile": EthernetProfile.from_dict(obj["ethernetProfile"]) if obj.get("ethernetProfile") is not None else None, + "ethernetProfile": EndpointAgentEthernetProfile.from_dict(obj["ethernetProfile"]) if obj.get("ethernetProfile") is not None else None, "wirelessProfile": WirelessProfile.from_dict(obj["wirelessProfile"]) if obj.get("wirelessProfile") is not None else None }) return _obj diff --git a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/platform.py b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/platform.py index 80106ed7c..76f0d9452 100644 --- a/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/platform.py +++ b/thousandeyes-sdk-endpoint-agents/src/thousandeyes_sdk/endpoint_agents/models/platform.py @@ -19,13 +19,16 @@ class Platform(str, Enum): """ - OS platform types + OS platform types. Platform \"linux\" was recently renamed to \"roomos\". """ """ allowed enum values """ WINDOWS = 'windows' + ROOMOS = 'roomos' + PHONEOS = 'phoneos' + ELUX = 'elux' LINUX = 'linux' MAC = 'mac' diff --git a/thousandeyes-sdk-endpoint-agents/test/test_endpoint_agents_api.py b/thousandeyes-sdk-endpoint-agents/test/test_endpoint_agents_api.py new file mode 100644 index 000000000..f398ead56 --- /dev/null +++ b/thousandeyes-sdk-endpoint-agents/test/test_endpoint_agents_api.py @@ -0,0 +1,1392 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. For more information about Endpoint Agents, see [Endpoint Agents](https://docs.thousandeyes.com/product-documentation/global-vantage-points/endpoint-agents). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.endpoint_agents.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.endpoint_agents.api.endpoint_agents_api import EndpointAgentsApi + + +class TestEndpointAgentsApi(unittest.TestCase): + """EndpointAgentsApi unit test stubs""" + + def setUp(self) -> None: + self.api = EndpointAgentsApi() + + def tearDown(self) -> None: + pass + + def test_delete_endpoint_agent_models_validation(self) -> None: + """Test case for delete_endpoint_agent request and response models""" + + + def test_disable_endpoint_agent_models_validation(self) -> None: + """Test case for disable_endpoint_agent request and response models""" + + response_body_json = """ + { + "npcapVersion" : "npcapVersion", + "asnDetails" : { + "asName" : "Virgin Media Limited", + "asNumber" : 5089 + }, + "clients" : [ { + "browserExtensions" : [ { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + }, { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + } ], + "userProfile" : { + "userName" : "joeblogs32" + } + }, { + "browserExtensions" : [ { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + }, { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + } ], + "userProfile" : { + "userName" : "joeblogs32" + } + } ], + "agentType" : "endpoint", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "publicIP" : "88.45.2.123", + "tcpDriverAvailable" : true, + "platform" : "mac", + "manufacturer" : "Apple, Inc.", + "createdAt" : "2022-05-26T23:37:16Z", + "numberOfClients" : 3, + "licenseType" : "essentials", + "osVersion" : "Version 10.15.2 (Build 19C57)", + "computerName" : "DESKJET-123", + "model" : "MacBookAir7,2", + "id" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "version" : "0.123.4", + "vpnProfiles" : [ { + "vpnClientNetworkRange" : [ "10.100.0.0/22" ], + "vpnGatewayAddress" : "vpnGatewayAddress", + "vpnType" : "cisco-anyconnect", + "interfaceName" : "interfaceName", + "vpnClientAddresses" : [ "10.100.0.10" ] + }, { + "vpnClientNetworkRange" : [ "10.100.0.0/22" ], + "vpnGatewayAddress" : "vpnGatewayAddress", + "vpnType" : "cisco-anyconnect", + "interfaceName" : "interfaceName", + "vpnClientAddresses" : [ "10.100.0.10" ] + } ], + "lastSeen" : "2022-05-26T23:37:16Z", + "deleted" : true, + "totalMemory" : "16384 MB", + "kernelVersion" : "Darwin 19.2.0", + "name" : "Office Printer", + "location" : { + "locationName" : "London", + "latitude" : 51.51279, + "longitude" : -0.09184 + }, + "aid" : "", + "status" : "enabled", + "networkInterfaceProfiles" : [ { + "ethernetProfile" : { + "linkSpeed" : 0 + }, + "hardwareType" : "wireless", + "interfaceName" : "en0", + "addressProfiles" : [ { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + }, { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + } ], + "wirelessProfile" : { + "rssi" : -36, + "bssid" : "00:11:22:aa:bb:cc", + "channel" : 48, + "phyMode" : "802.11ac", + "ssid" : "GuestWiFi" + } + }, { + "ethernetProfile" : { + "linkSpeed" : 0 + }, + "hardwareType" : "wireless", + "interfaceName" : "en0", + "addressProfiles" : [ { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + }, { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + } ], + "wirelessProfile" : { + "rssi" : -36, + "bssid" : "00:11:22:aa:bb:cc", + "channel" : 48, + "phyMode" : "802.11ac", + "ssid" : "GuestWiFi" + } + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_agents.models.EndpointAgent.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_enable_endpoint_agent_models_validation(self) -> None: + """Test case for enable_endpoint_agent request and response models""" + + response_body_json = """ + { + "npcapVersion" : "npcapVersion", + "asnDetails" : { + "asName" : "Virgin Media Limited", + "asNumber" : 5089 + }, + "clients" : [ { + "browserExtensions" : [ { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + }, { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + } ], + "userProfile" : { + "userName" : "joeblogs32" + } + }, { + "browserExtensions" : [ { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + }, { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + } ], + "userProfile" : { + "userName" : "joeblogs32" + } + } ], + "agentType" : "endpoint", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "publicIP" : "88.45.2.123", + "tcpDriverAvailable" : true, + "platform" : "mac", + "manufacturer" : "Apple, Inc.", + "createdAt" : "2022-05-26T23:37:16Z", + "numberOfClients" : 3, + "licenseType" : "essentials", + "osVersion" : "Version 10.15.2 (Build 19C57)", + "computerName" : "DESKJET-123", + "model" : "MacBookAir7,2", + "id" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "version" : "0.123.4", + "vpnProfiles" : [ { + "vpnClientNetworkRange" : [ "10.100.0.0/22" ], + "vpnGatewayAddress" : "vpnGatewayAddress", + "vpnType" : "cisco-anyconnect", + "interfaceName" : "interfaceName", + "vpnClientAddresses" : [ "10.100.0.10" ] + }, { + "vpnClientNetworkRange" : [ "10.100.0.0/22" ], + "vpnGatewayAddress" : "vpnGatewayAddress", + "vpnType" : "cisco-anyconnect", + "interfaceName" : "interfaceName", + "vpnClientAddresses" : [ "10.100.0.10" ] + } ], + "lastSeen" : "2022-05-26T23:37:16Z", + "deleted" : true, + "totalMemory" : "16384 MB", + "kernelVersion" : "Darwin 19.2.0", + "name" : "Office Printer", + "location" : { + "locationName" : "London", + "latitude" : 51.51279, + "longitude" : -0.09184 + }, + "aid" : "", + "status" : "enabled", + "networkInterfaceProfiles" : [ { + "ethernetProfile" : { + "linkSpeed" : 0 + }, + "hardwareType" : "wireless", + "interfaceName" : "en0", + "addressProfiles" : [ { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + }, { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + } ], + "wirelessProfile" : { + "rssi" : -36, + "bssid" : "00:11:22:aa:bb:cc", + "channel" : 48, + "phyMode" : "802.11ac", + "ssid" : "GuestWiFi" + } + }, { + "ethernetProfile" : { + "linkSpeed" : 0 + }, + "hardwareType" : "wireless", + "interfaceName" : "en0", + "addressProfiles" : [ { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + }, { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + } ], + "wirelessProfile" : { + "rssi" : -36, + "bssid" : "00:11:22:aa:bb:cc", + "channel" : 48, + "phyMode" : "802.11ac", + "ssid" : "GuestWiFi" + } + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_agents.models.EndpointAgent.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_filter_endpoint_agents_models_validation(self) -> None: + """Test case for filter_endpoint_agents request and response models""" + request_body_json = """ + { + "searchSort" : [ { + "sort" : "platform", + "order" : "desc" + }, { + "sort" : "platform", + "order" : "desc" + } ], + "searchFilters" : { + "licenseType" : [ "essentials", "essentials" ], + "osVersion" : [ "Version 10.15.2", "Version 10.15.2" ], + "computerName" : [ "DESKTOP-45AE8", "DESKTOP-45AE8" ], + "locationCountryISO" : [ "FR", "FR" ], + "agentName" : [ "myagent-1234", "myagent-1234" ], + "locationSubdivision1Code" : [ "ENG", "ENG" ], + "id" : [ "861b7557-cd57-4bbb-b648-00bddf88ef49", "861b7557-cd57-4bbb-b648-00bddf88ef49" ], + "platform" : [ "mac", "mac" ], + "locationCity" : [ "Paris", "Paris" ], + "username" : [ "picard" ] + }, + "thresholdFilter" : { + "conditionalOperator" : "and", + "filters" : [ { + "name" : "last-seen-ms", + "value" : 0.8008281904610115, + "operator" : "gte" + }, { + "name" : "last-seen-ms", + "value" : 0.8008281904610115, + "operator" : "gte" + } ] + } + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_agents.models.AgentSearchRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "totalAgents" : 1, + "agents" : [ { + "npcapVersion" : "npcapVersion", + "asnDetails" : { + "asName" : "Virgin Media Limited", + "asNumber" : 5089 + }, + "clients" : [ { + "browserExtensions" : [ { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + }, { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + } ], + "userProfile" : { + "userName" : "joeblogs32" + } + }, { + "browserExtensions" : [ { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + }, { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + } ], + "userProfile" : { + "userName" : "joeblogs32" + } + } ], + "agentType" : "endpoint", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "publicIP" : "88.45.2.123", + "tcpDriverAvailable" : true, + "platform" : "mac", + "manufacturer" : "Apple, Inc.", + "createdAt" : "2022-05-26T23:37:16Z", + "numberOfClients" : 3, + "licenseType" : "essentials", + "osVersion" : "Version 10.15.2 (Build 19C57)", + "computerName" : "DESKJET-123", + "model" : "MacBookAir7,2", + "id" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "version" : "0.123.4", + "vpnProfiles" : [ { + "vpnClientNetworkRange" : [ "10.100.0.0/22" ], + "vpnGatewayAddress" : "vpnGatewayAddress", + "vpnType" : "cisco-anyconnect", + "interfaceName" : "interfaceName", + "vpnClientAddresses" : [ "10.100.0.10" ] + }, { + "vpnClientNetworkRange" : [ "10.100.0.0/22" ], + "vpnGatewayAddress" : "vpnGatewayAddress", + "vpnType" : "cisco-anyconnect", + "interfaceName" : "interfaceName", + "vpnClientAddresses" : [ "10.100.0.10" ] + } ], + "lastSeen" : "2022-05-26T23:37:16Z", + "deleted" : true, + "totalMemory" : "16384 MB", + "kernelVersion" : "Darwin 19.2.0", + "name" : "Office Printer", + "location" : { + "locationName" : "London", + "latitude" : 51.51279, + "longitude" : -0.09184 + }, + "aid" : "", + "status" : "enabled", + "networkInterfaceProfiles" : [ { + "ethernetProfile" : { + "linkSpeed" : 0 + }, + "hardwareType" : "wireless", + "interfaceName" : "en0", + "addressProfiles" : [ { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + }, { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + } ], + "wirelessProfile" : { + "rssi" : -36, + "bssid" : "00:11:22:aa:bb:cc", + "channel" : 48, + "phyMode" : "802.11ac", + "ssid" : "GuestWiFi" + } + }, { + "ethernetProfile" : { + "linkSpeed" : 0 + }, + "hardwareType" : "wireless", + "interfaceName" : "en0", + "addressProfiles" : [ { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + }, { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + } ], + "wirelessProfile" : { + "rssi" : -36, + "bssid" : "00:11:22:aa:bb:cc", + "channel" : 48, + "phyMode" : "802.11ac", + "ssid" : "GuestWiFi" + } + } ] + }, { + "npcapVersion" : "npcapVersion", + "asnDetails" : { + "asName" : "Virgin Media Limited", + "asNumber" : 5089 + }, + "clients" : [ { + "browserExtensions" : [ { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + }, { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + } ], + "userProfile" : { + "userName" : "joeblogs32" + } + }, { + "browserExtensions" : [ { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + }, { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + } ], + "userProfile" : { + "userName" : "joeblogs32" + } + } ], + "agentType" : "endpoint", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "publicIP" : "88.45.2.123", + "tcpDriverAvailable" : true, + "platform" : "mac", + "manufacturer" : "Apple, Inc.", + "createdAt" : "2022-05-26T23:37:16Z", + "numberOfClients" : 3, + "licenseType" : "essentials", + "osVersion" : "Version 10.15.2 (Build 19C57)", + "computerName" : "DESKJET-123", + "model" : "MacBookAir7,2", + "id" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "version" : "0.123.4", + "vpnProfiles" : [ { + "vpnClientNetworkRange" : [ "10.100.0.0/22" ], + "vpnGatewayAddress" : "vpnGatewayAddress", + "vpnType" : "cisco-anyconnect", + "interfaceName" : "interfaceName", + "vpnClientAddresses" : [ "10.100.0.10" ] + }, { + "vpnClientNetworkRange" : [ "10.100.0.0/22" ], + "vpnGatewayAddress" : "vpnGatewayAddress", + "vpnType" : "cisco-anyconnect", + "interfaceName" : "interfaceName", + "vpnClientAddresses" : [ "10.100.0.10" ] + } ], + "lastSeen" : "2022-05-26T23:37:16Z", + "deleted" : true, + "totalMemory" : "16384 MB", + "kernelVersion" : "Darwin 19.2.0", + "name" : "Office Printer", + "location" : { + "locationName" : "London", + "latitude" : 51.51279, + "longitude" : -0.09184 + }, + "aid" : "", + "status" : "enabled", + "networkInterfaceProfiles" : [ { + "ethernetProfile" : { + "linkSpeed" : 0 + }, + "hardwareType" : "wireless", + "interfaceName" : "en0", + "addressProfiles" : [ { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + }, { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + } ], + "wirelessProfile" : { + "rssi" : -36, + "bssid" : "00:11:22:aa:bb:cc", + "channel" : 48, + "phyMode" : "802.11ac", + "ssid" : "GuestWiFi" + } + }, { + "ethernetProfile" : { + "linkSpeed" : 0 + }, + "hardwareType" : "wireless", + "interfaceName" : "en0", + "addressProfiles" : [ { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + }, { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + } ], + "wirelessProfile" : { + "rssi" : -36, + "bssid" : "00:11:22:aa:bb:cc", + "channel" : 48, + "phyMode" : "802.11ac", + "ssid" : "GuestWiFi" + } + } ] + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_agents.models.FilterEndpointAgentsResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_endpoint_agent_models_validation(self) -> None: + """Test case for get_endpoint_agent request and response models""" + + response_body_json = """ + { + "npcapVersion" : "npcapVersion", + "asnDetails" : { + "asName" : "Virgin Media Limited", + "asNumber" : 5089 + }, + "clients" : [ { + "browserExtensions" : [ { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + }, { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + } ], + "userProfile" : { + "userName" : "joeblogs32" + } + }, { + "browserExtensions" : [ { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + }, { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + } ], + "userProfile" : { + "userName" : "joeblogs32" + } + } ], + "agentType" : "endpoint", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "publicIP" : "88.45.2.123", + "tcpDriverAvailable" : true, + "platform" : "mac", + "manufacturer" : "Apple, Inc.", + "createdAt" : "2022-05-26T23:37:16Z", + "numberOfClients" : 3, + "licenseType" : "essentials", + "osVersion" : "Version 10.15.2 (Build 19C57)", + "computerName" : "DESKJET-123", + "model" : "MacBookAir7,2", + "id" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "version" : "0.123.4", + "vpnProfiles" : [ { + "vpnClientNetworkRange" : [ "10.100.0.0/22" ], + "vpnGatewayAddress" : "vpnGatewayAddress", + "vpnType" : "cisco-anyconnect", + "interfaceName" : "interfaceName", + "vpnClientAddresses" : [ "10.100.0.10" ] + }, { + "vpnClientNetworkRange" : [ "10.100.0.0/22" ], + "vpnGatewayAddress" : "vpnGatewayAddress", + "vpnType" : "cisco-anyconnect", + "interfaceName" : "interfaceName", + "vpnClientAddresses" : [ "10.100.0.10" ] + } ], + "lastSeen" : "2022-05-26T23:37:16Z", + "deleted" : true, + "totalMemory" : "16384 MB", + "kernelVersion" : "Darwin 19.2.0", + "name" : "Office Printer", + "location" : { + "locationName" : "London", + "latitude" : 51.51279, + "longitude" : -0.09184 + }, + "aid" : "", + "status" : "enabled", + "networkInterfaceProfiles" : [ { + "ethernetProfile" : { + "linkSpeed" : 0 + }, + "hardwareType" : "wireless", + "interfaceName" : "en0", + "addressProfiles" : [ { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + }, { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + } ], + "wirelessProfile" : { + "rssi" : -36, + "bssid" : "00:11:22:aa:bb:cc", + "channel" : 48, + "phyMode" : "802.11ac", + "ssid" : "GuestWiFi" + } + }, { + "ethernetProfile" : { + "linkSpeed" : 0 + }, + "hardwareType" : "wireless", + "interfaceName" : "en0", + "addressProfiles" : [ { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + }, { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + } ], + "wirelessProfile" : { + "rssi" : -36, + "bssid" : "00:11:22:aa:bb:cc", + "channel" : 48, + "phyMode" : "802.11ac", + "ssid" : "GuestWiFi" + } + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_agents.models.EndpointAgent.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_endpoint_agents_models_validation(self) -> None: + """Test case for get_endpoint_agents request and response models""" + + response_body_json = """ + { + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "totalAgents" : 1, + "agents" : [ { + "npcapVersion" : "npcapVersion", + "asnDetails" : { + "asName" : "Virgin Media Limited", + "asNumber" : 5089 + }, + "clients" : [ { + "browserExtensions" : [ { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + }, { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + } ], + "userProfile" : { + "userName" : "joeblogs32" + } + }, { + "browserExtensions" : [ { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + }, { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + } ], + "userProfile" : { + "userName" : "joeblogs32" + } + } ], + "agentType" : "endpoint", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "publicIP" : "88.45.2.123", + "tcpDriverAvailable" : true, + "platform" : "mac", + "manufacturer" : "Apple, Inc.", + "createdAt" : "2022-05-26T23:37:16Z", + "numberOfClients" : 3, + "licenseType" : "essentials", + "osVersion" : "Version 10.15.2 (Build 19C57)", + "computerName" : "DESKJET-123", + "model" : "MacBookAir7,2", + "id" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "version" : "0.123.4", + "vpnProfiles" : [ { + "vpnClientNetworkRange" : [ "10.100.0.0/22" ], + "vpnGatewayAddress" : "vpnGatewayAddress", + "vpnType" : "cisco-anyconnect", + "interfaceName" : "interfaceName", + "vpnClientAddresses" : [ "10.100.0.10" ] + }, { + "vpnClientNetworkRange" : [ "10.100.0.0/22" ], + "vpnGatewayAddress" : "vpnGatewayAddress", + "vpnType" : "cisco-anyconnect", + "interfaceName" : "interfaceName", + "vpnClientAddresses" : [ "10.100.0.10" ] + } ], + "lastSeen" : "2022-05-26T23:37:16Z", + "deleted" : true, + "totalMemory" : "16384 MB", + "kernelVersion" : "Darwin 19.2.0", + "name" : "Office Printer", + "location" : { + "locationName" : "London", + "latitude" : 51.51279, + "longitude" : -0.09184 + }, + "aid" : "", + "status" : "enabled", + "networkInterfaceProfiles" : [ { + "ethernetProfile" : { + "linkSpeed" : 0 + }, + "hardwareType" : "wireless", + "interfaceName" : "en0", + "addressProfiles" : [ { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + }, { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + } ], + "wirelessProfile" : { + "rssi" : -36, + "bssid" : "00:11:22:aa:bb:cc", + "channel" : 48, + "phyMode" : "802.11ac", + "ssid" : "GuestWiFi" + } + }, { + "ethernetProfile" : { + "linkSpeed" : 0 + }, + "hardwareType" : "wireless", + "interfaceName" : "en0", + "addressProfiles" : [ { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + }, { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + } ], + "wirelessProfile" : { + "rssi" : -36, + "bssid" : "00:11:22:aa:bb:cc", + "channel" : 48, + "phyMode" : "802.11ac", + "ssid" : "GuestWiFi" + } + } ] + }, { + "npcapVersion" : "npcapVersion", + "asnDetails" : { + "asName" : "Virgin Media Limited", + "asNumber" : 5089 + }, + "clients" : [ { + "browserExtensions" : [ { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + }, { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + } ], + "userProfile" : { + "userName" : "joeblogs32" + } + }, { + "browserExtensions" : [ { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + }, { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + } ], + "userProfile" : { + "userName" : "joeblogs32" + } + } ], + "agentType" : "endpoint", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "publicIP" : "88.45.2.123", + "tcpDriverAvailable" : true, + "platform" : "mac", + "manufacturer" : "Apple, Inc.", + "createdAt" : "2022-05-26T23:37:16Z", + "numberOfClients" : 3, + "licenseType" : "essentials", + "osVersion" : "Version 10.15.2 (Build 19C57)", + "computerName" : "DESKJET-123", + "model" : "MacBookAir7,2", + "id" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "version" : "0.123.4", + "vpnProfiles" : [ { + "vpnClientNetworkRange" : [ "10.100.0.0/22" ], + "vpnGatewayAddress" : "vpnGatewayAddress", + "vpnType" : "cisco-anyconnect", + "interfaceName" : "interfaceName", + "vpnClientAddresses" : [ "10.100.0.10" ] + }, { + "vpnClientNetworkRange" : [ "10.100.0.0/22" ], + "vpnGatewayAddress" : "vpnGatewayAddress", + "vpnType" : "cisco-anyconnect", + "interfaceName" : "interfaceName", + "vpnClientAddresses" : [ "10.100.0.10" ] + } ], + "lastSeen" : "2022-05-26T23:37:16Z", + "deleted" : true, + "totalMemory" : "16384 MB", + "kernelVersion" : "Darwin 19.2.0", + "name" : "Office Printer", + "location" : { + "locationName" : "London", + "latitude" : 51.51279, + "longitude" : -0.09184 + }, + "aid" : "", + "status" : "enabled", + "networkInterfaceProfiles" : [ { + "ethernetProfile" : { + "linkSpeed" : 0 + }, + "hardwareType" : "wireless", + "interfaceName" : "en0", + "addressProfiles" : [ { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + }, { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + } ], + "wirelessProfile" : { + "rssi" : -36, + "bssid" : "00:11:22:aa:bb:cc", + "channel" : 48, + "phyMode" : "802.11ac", + "ssid" : "GuestWiFi" + } + }, { + "ethernetProfile" : { + "linkSpeed" : 0 + }, + "hardwareType" : "wireless", + "interfaceName" : "en0", + "addressProfiles" : [ { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + }, { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + } ], + "wirelessProfile" : { + "rssi" : -36, + "bssid" : "00:11:22:aa:bb:cc", + "channel" : 48, + "phyMode" : "802.11ac", + "ssid" : "GuestWiFi" + } + } ] + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_agents.models.ListEndpointAgentsResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_endpoint_agents_connection_string_models_validation(self) -> None: + """Test case for get_endpoint_agents_connection_string request and response models""" + + response_body_json = """ + { + "connectionString" : "D2xZSLlqo64Xe2EnYisklA==", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_agents.models.ConnectionString.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_endpoint_agent_models_validation(self) -> None: + """Test case for update_endpoint_agent request and response models""" + request_body_json = """ + { + "licenseType" : "essentials", + "name" : "Office Printer" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_agents.models.EndpointAgentUpdate.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "npcapVersion" : "npcapVersion", + "asnDetails" : { + "asName" : "Virgin Media Limited", + "asNumber" : 5089 + }, + "clients" : [ { + "browserExtensions" : [ { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + }, { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + } ], + "userProfile" : { + "userName" : "joeblogs32" + } + }, { + "browserExtensions" : [ { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + }, { + "browser" : "edge", + "profile" : "Profile 1", + "active" : true, + "error" : "", + "version" : "0.123.0", + "enabled" : true + } ], + "userProfile" : { + "userName" : "joeblogs32" + } + } ], + "agentType" : "endpoint", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "publicIP" : "88.45.2.123", + "tcpDriverAvailable" : true, + "platform" : "mac", + "manufacturer" : "Apple, Inc.", + "createdAt" : "2022-05-26T23:37:16Z", + "numberOfClients" : 3, + "licenseType" : "essentials", + "osVersion" : "Version 10.15.2 (Build 19C57)", + "computerName" : "DESKJET-123", + "model" : "MacBookAir7,2", + "id" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "version" : "0.123.4", + "vpnProfiles" : [ { + "vpnClientNetworkRange" : [ "10.100.0.0/22" ], + "vpnGatewayAddress" : "vpnGatewayAddress", + "vpnType" : "cisco-anyconnect", + "interfaceName" : "interfaceName", + "vpnClientAddresses" : [ "10.100.0.10" ] + }, { + "vpnClientNetworkRange" : [ "10.100.0.0/22" ], + "vpnGatewayAddress" : "vpnGatewayAddress", + "vpnType" : "cisco-anyconnect", + "interfaceName" : "interfaceName", + "vpnClientAddresses" : [ "10.100.0.10" ] + } ], + "lastSeen" : "2022-05-26T23:37:16Z", + "deleted" : true, + "totalMemory" : "16384 MB", + "kernelVersion" : "Darwin 19.2.0", + "name" : "Office Printer", + "location" : { + "locationName" : "London", + "latitude" : 51.51279, + "longitude" : -0.09184 + }, + "aid" : "", + "status" : "enabled", + "networkInterfaceProfiles" : [ { + "ethernetProfile" : { + "linkSpeed" : 0 + }, + "hardwareType" : "wireless", + "interfaceName" : "en0", + "addressProfiles" : [ { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + }, { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + } ], + "wirelessProfile" : { + "rssi" : -36, + "bssid" : "00:11:22:aa:bb:cc", + "channel" : 48, + "phyMode" : "802.11ac", + "ssid" : "GuestWiFi" + } + }, { + "ethernetProfile" : { + "linkSpeed" : 0 + }, + "hardwareType" : "wireless", + "interfaceName" : "en0", + "addressProfiles" : [ { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + }, { + "prefixLength" : 24, + "addressType" : "unique-local", + "ipAddress" : "2001:db8:3333:4444:5555:6666:7777:8888", + "routerHardwareAddress" : "5c:b1:3e:46:1c:84", + "gateway" : "192.168.0.254" + } ], + "wirelessProfile" : { + "rssi" : -36, + "bssid" : "00:11:22:aa:bb:cc", + "channel" : 48, + "phyMode" : "802.11ac", + "ssid" : "GuestWiFi" + } + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_agents.models.EndpointAgent.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-endpoint-agents/test/test_endpoint_agents_transfer_api.py b/thousandeyes-sdk-endpoint-agents/test/test_endpoint_agents_transfer_api.py new file mode 100644 index 000000000..e86a3c774 --- /dev/null +++ b/thousandeyes-sdk-endpoint-agents/test/test_endpoint_agents_transfer_api.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Endpoint Agents API + + Manage ThousandEyes Endpoint Agents using this API. For more information about Endpoint Agents, see [Endpoint Agents](https://docs.thousandeyes.com/product-documentation/global-vantage-points/endpoint-agents). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.endpoint_agents.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.endpoint_agents.api.endpoint_agents_transfer_api import EndpointAgentsTransferApi + + +class TestEndpointAgentsTransferApi(unittest.TestCase): + """EndpointAgentsTransferApi unit test stubs""" + + def setUp(self) -> None: + self.api = EndpointAgentsTransferApi() + + def tearDown(self) -> None: + pass + + def test_transfer_endpoint_agent_models_validation(self) -> None: + """Test case for transfer_endpoint_agent request and response models""" + request_body_json = """ + { + "toAid" : "1234" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_agents.models.AgentTransferRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + + def test_transfer_endpoint_agents_models_validation(self) -> None: + """Test case for transfer_endpoint_agents request and response models""" + request_body_json = """ + { + "transfers" : [ { + "agentId" : "5d0764ac-7e42-4ec8-a0d4-39fc53edccba", + "fromAid" : "1234", + "toAid" : "12345" + }, { + "agentId" : "5d0764ac-7e42-4ec8-a0d4-39fc53edccba", + "fromAid" : "1234", + "toAid" : "12345" + } ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_agents.models.BulkAgentTransferRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "items" : [ { + "status" : 200, + "detail" : "Initiated", + "request" : { + "agentId" : "5d0764ac-7e42-4ec8-a0d4-39fc53edccba", + "fromAid" : "1234", + "toAid" : "12345" + } + }, { + "status" : 400, + "detail" : "Missing from-account id", + "request" : { + "agentId" : "5d0764ac-7e42-4ec8-a0d5-39fc53ed1234", + "fromAid" : "xxx", + "toAid" : "12345" + } + }, { + "status" : 403, + "detail" : "User does not have permission on 'to' aid", + "request" : { + "agentId" : "5d0764ac-7e42-4ec8-a0d5-39fc53ed7890", + "fromAid" : "1234", + "toAid" : "12345" + } + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_agents.models.BulkAgentTransferResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-endpoint-instant-tests/.openapi-generator/FILES b/thousandeyes-sdk-endpoint-instant-tests/.openapi-generator/FILES index e24310b89..d4f6ff8e4 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/.openapi-generator/FILES +++ b/thousandeyes-sdk-endpoint-instant-tests/.openapi-generator/FILES @@ -1,11 +1,7 @@ .openapi-generator-ignore MANIFEST.in README.md -docs/AgentToServerInstantScheduledTestApi.md -docs/AlertDirection.md -docs/AlertRoundsViolationMode.md -docs/AlertRule.md -docs/AlertType.md +docs/AgentToServerEndpointInstantScheduledTestsApi.md docs/EndpointAgentLabelsSelectorConfig.md docs/EndpointAgentSelectorConfig.md docs/EndpointAgentToServerInstantTest.md @@ -15,6 +11,7 @@ docs/EndpointHttpServerBaseTest.md docs/EndpointHttpServerInstantTest.md docs/EndpointHttpServerTest.md docs/EndpointInstantTest.md +docs/EndpointRunScheduledInstantTestResult.md docs/EndpointScheduledTestType.md docs/EndpointSpecificAgentsSelectorConfig.md docs/EndpointTest.md @@ -24,11 +21,9 @@ docs/EndpointTestLinks.md docs/EndpointTestProtocol.md docs/EndpointTestSelfLink.md docs/Error.md -docs/HttpServerInstantScheduledTestApi.md +docs/HTTPServerEndpointInstantScheduledTestsApi.md docs/Link.md -docs/RunExistingTestApi.md -docs/SensitivityLevel.md -docs/Severity.md +docs/RunEndpointInstantScheduledTestsApi.md docs/TestInterval.md docs/TestLabel.md docs/TestProbeModeResponse.md @@ -40,14 +35,10 @@ pyproject.toml setup.cfg src/thousandeyes_sdk/endpoint_instant_tests/__init__.py src/thousandeyes_sdk/endpoint_instant_tests/api/__init__.py -src/thousandeyes_sdk/endpoint_instant_tests/api/agent_to_server_instant_scheduled_test_api.py -src/thousandeyes_sdk/endpoint_instant_tests/api/http_server_instant_scheduled_test_api.py -src/thousandeyes_sdk/endpoint_instant_tests/api/run_existing_test_api.py +src/thousandeyes_sdk/endpoint_instant_tests/api/agent_to_server_endpoint_instant_scheduled_tests_api.py +src/thousandeyes_sdk/endpoint_instant_tests/api/http_server_endpoint_instant_scheduled_tests_api.py +src/thousandeyes_sdk/endpoint_instant_tests/api/run_endpoint_instant_scheduled_tests_api.py src/thousandeyes_sdk/endpoint_instant_tests/models/__init__.py -src/thousandeyes_sdk/endpoint_instant_tests/models/alert_direction.py -src/thousandeyes_sdk/endpoint_instant_tests/models/alert_rounds_violation_mode.py -src/thousandeyes_sdk/endpoint_instant_tests/models/alert_rule.py -src/thousandeyes_sdk/endpoint_instant_tests/models/alert_type.py src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_agent_labels_selector_config.py src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_agent_selector_config.py src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_agent_to_server_instant_test.py @@ -57,6 +48,7 @@ src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_http_server_base_tes src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_http_server_instant_test.py src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_http_server_test.py src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_instant_test.py +src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_run_scheduled_instant_test_result.py src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_scheduled_test_type.py src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_specific_agents_selector_config.py src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_test.py @@ -67,8 +59,6 @@ src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_test_protocol.py src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_test_self_link.py src/thousandeyes_sdk/endpoint_instant_tests/models/error.py src/thousandeyes_sdk/endpoint_instant_tests/models/link.py -src/thousandeyes_sdk/endpoint_instant_tests/models/sensitivity_level.py -src/thousandeyes_sdk/endpoint_instant_tests/models/severity.py src/thousandeyes_sdk/endpoint_instant_tests/models/test_interval.py src/thousandeyes_sdk/endpoint_instant_tests/models/test_label.py src/thousandeyes_sdk/endpoint_instant_tests/models/test_probe_mode_response.py @@ -78,7 +68,7 @@ src/thousandeyes_sdk/endpoint_instant_tests/models/validation_error.py src/thousandeyes_sdk/endpoint_instant_tests/models/validation_error_item.py src/thousandeyes_sdk/endpoint_instant_tests/py.typed test/__init__.py -test/test_agent_to_server_instant_scheduled_test_api.py -test/test_http_server_instant_scheduled_test_api.py -test/test_run_existing_test_api.py +test/test_agent_to_server_endpoint_instant_scheduled_tests_api.py +test/test_http_server_endpoint_instant_scheduled_tests_api.py +test/test_run_endpoint_instant_scheduled_tests_api.py test/test_utils.py diff --git a/thousandeyes-sdk-endpoint-instant-tests/README.md b/thousandeyes-sdk-endpoint-instant-tests/README.md index 1c03dafa2..dc8b785f5 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/README.md +++ b/thousandeyes-sdk-endpoint-instant-tests/README.md @@ -13,7 +13,7 @@ The URLs for these API test data endpoints are provided within the test definiti This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -85,17 +85,17 @@ configuration = thousandeyes_sdk.core.Configuration( # Enter a context with an instance of the API client with thousandeyes_sdk.core.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.endpoint_instant_tests.AgentToServerInstantScheduledTestApi(api_client) + api_instance = thousandeyes_sdk.endpoint_instant_tests.AgentToServerEndpointInstantScheduledTestsApi(api_client) endpoint_agent_to_server_instant_test = thousandeyes_sdk.endpoint_instant_tests.EndpointAgentToServerInstantTest() # EndpointAgentToServerInstantTest | aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) try: # Run agent to server instant scheduled test api_response = api_instance.create_agent_to_server_scheduled_instant_test(endpoint_agent_to_server_instant_test, aid=aid) - print("The response of AgentToServerInstantScheduledTestApi->create_agent_to_server_scheduled_instant_test:\n") + print("The response of AgentToServerEndpointInstantScheduledTestsApi->create_agent_to_server_scheduled_instant_test:\n") pprint(api_response) except ApiException as e: - print("Exception when calling AgentToServerInstantScheduledTestApi->create_agent_to_server_scheduled_instant_test: %s\n" % e) + print("Exception when calling AgentToServerEndpointInstantScheduledTestsApi->create_agent_to_server_scheduled_instant_test: %s\n" % e) ``` @@ -105,17 +105,13 @@ All URIs are relative to *https://api.thousandeyes.com/v7* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AgentToServerInstantScheduledTestApi* | [**create_agent_to_server_scheduled_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/AgentToServerInstantScheduledTestApi.md#create_agent_to_server_scheduled_instant_test) | **POST** /endpoint/tests/scheduled-tests/agent-to-server/instant | Run agent to server instant scheduled test -*HttpServerInstantScheduledTestApi* | [**create_http_server_scheduled_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/HttpServerInstantScheduledTestApi.md#create_http_server_scheduled_instant_test) | **POST** /endpoint/tests/scheduled-tests/http-server/instant | Run http server instant scheduled test -*RunExistingTestApi* | [**run_endpoint_scheduled_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/RunExistingTestApi.md#run_endpoint_scheduled_instant_test) | **POST** /endpoint/tests/scheduled-tests/{testId}/run | Run endpoint instant scheduled test +*AgentToServerEndpointInstantScheduledTestsApi* | [**create_agent_to_server_scheduled_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/AgentToServerEndpointInstantScheduledTestsApi.md#create_agent_to_server_scheduled_instant_test) | **POST** /endpoint/tests/scheduled-tests/agent-to-server/instant | Run agent to server instant scheduled test +*HTTPServerEndpointInstantScheduledTestsApi* | [**create_http_server_scheduled_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/HTTPServerEndpointInstantScheduledTestsApi.md#create_http_server_scheduled_instant_test) | **POST** /endpoint/tests/scheduled-tests/http-server/instant | Run http server instant scheduled test +*RunEndpointInstantScheduledTestsApi* | [**run_endpoint_scheduled_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/RunEndpointInstantScheduledTestsApi.md#run_endpoint_scheduled_instant_test) | **POST** /endpoint/tests/scheduled-tests/{testId}/run | Run endpoint instant scheduled test ## Documentation For Models - - [AlertDirection](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/AlertDirection.md) - - [AlertRoundsViolationMode](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/AlertRoundsViolationMode.md) - - [AlertRule](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/AlertRule.md) - - [AlertType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/AlertType.md) - [EndpointAgentLabelsSelectorConfig](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentLabelsSelectorConfig.md) - [EndpointAgentSelectorConfig](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentSelectorConfig.md) - [EndpointAgentToServerInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentToServerInstantTest.md) @@ -125,6 +121,7 @@ Class | Method | HTTP request | Description - [EndpointHttpServerInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointHttpServerInstantTest.md) - [EndpointHttpServerTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointHttpServerTest.md) - [EndpointInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointInstantTest.md) + - [EndpointRunScheduledInstantTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointRunScheduledInstantTestResult.md) - [EndpointScheduledTestType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointScheduledTestType.md) - [EndpointSpecificAgentsSelectorConfig](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointSpecificAgentsSelectorConfig.md) - [EndpointTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointTest.md) @@ -135,8 +132,6 @@ Class | Method | HTTP request | Description - [EndpointTestSelfLink](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointTestSelfLink.md) - [Error](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/Error.md) - [Link](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/Link.md) - - [SensitivityLevel](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/SensitivityLevel.md) - - [Severity](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/Severity.md) - [TestInterval](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/TestInterval.md) - [TestLabel](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/TestLabel.md) - [TestProbeModeResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-instant-tests/docs/TestProbeModeResponse.md) diff --git a/thousandeyes-sdk-endpoint-instant-tests/docs/AgentToServerEndpointInstantScheduledTestsApi.md b/thousandeyes-sdk-endpoint-instant-tests/docs/AgentToServerEndpointInstantScheduledTestsApi.md new file mode 100644 index 000000000..5e5bbfb38 --- /dev/null +++ b/thousandeyes-sdk-endpoint-instant-tests/docs/AgentToServerEndpointInstantScheduledTestsApi.md @@ -0,0 +1,97 @@ +# thousandeyes_sdk.endpoint_instant_tests.AgentToServerEndpointInstantScheduledTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_agent_to_server_scheduled_instant_test**](AgentToServerEndpointInstantScheduledTestsApi.md#create_agent_to_server_scheduled_instant_test) | **POST** /endpoint/tests/scheduled-tests/agent-to-server/instant | Run agent to server instant scheduled test + + +# **create_agent_to_server_scheduled_instant_test** +> EndpointAgentToServerTest create_agent_to_server_scheduled_instant_test(endpoint_agent_to_server_instant_test, aid=aid) + +Run agent to server instant scheduled test + +Creates and runs a new endpoint agent to server instant scheduled test in ThousandEyes. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_instant_tests +from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_agent_to_server_instant_test import EndpointAgentToServerInstantTest +from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_agent_to_server_test import EndpointAgentToServerTest +from thousandeyes_sdk.endpoint_instant_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_instant_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_instant_tests.AgentToServerEndpointInstantScheduledTestsApi(api_client) + endpoint_agent_to_server_instant_test = thousandeyes_sdk.endpoint_instant_tests.EndpointAgentToServerInstantTest() # EndpointAgentToServerInstantTest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Run agent to server instant scheduled test + api_response = api_instance.create_agent_to_server_scheduled_instant_test(endpoint_agent_to_server_instant_test, aid=aid) + print("The response of AgentToServerEndpointInstantScheduledTestsApi->create_agent_to_server_scheduled_instant_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerEndpointInstantScheduledTestsApi->create_agent_to_server_scheduled_instant_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **endpoint_agent_to_server_instant_test** | [**EndpointAgentToServerInstantTest**](EndpointAgentToServerInstantTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointAgentToServerTest**](EndpointAgentToServerTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentLabelsSelectorConfig.md b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentLabelsSelectorConfig.md index 2986a40dc..3c6a44ae4 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentLabelsSelectorConfig.md +++ b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentLabelsSelectorConfig.md @@ -7,7 +7,7 @@ Agent labels selection object. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **agent_selector_type** | **str** | | -**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] **endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] ## Example diff --git a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentSelectorConfig.md b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentSelectorConfig.md index e861a915a..351307431 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentSelectorConfig.md +++ b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentSelectorConfig.md @@ -7,7 +7,7 @@ Agents selection object based on agentSelectorType. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **agent_selector_type** | **str** | | -**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] **endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] **agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] diff --git a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentToServerInstantTest.md b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentToServerInstantTest.md index f68e9f29d..f8f29bb77 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentToServerInstantTest.md +++ b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentToServerInstantTest.md @@ -5,15 +5,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | +**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | [optional] **agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] -**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] -**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] **endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] -**max_machines** | **int** | Maximum number of agents which can execute the test. | -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] **test_name** | **str** | Name of the test. | **server_name** | **str** | A server address without a protocol or IP address. | +**port** | **int** | Port number. | [optional] [default to 443] ## Example diff --git a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentToServerTest.md b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentToServerTest.md index 427a02dde..724d37ab3 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentToServerTest.md +++ b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAgentToServerTest.md @@ -15,14 +15,13 @@ Name | Type | Description | Notes **has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] **modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] **protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] **server** | **str** | Target domain name or IP address. | [optional] **test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] **test_name** | **str** | Name of the test. | [optional] **type** | **str** | Type of test being queried. | [readonly] **tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] -**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**port** | **int** | Port number. | [optional] [default to 443] **labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAllAgentsSelectorConfig.md b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAllAgentsSelectorConfig.md index bbdfc76ba..40c21bdff 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAllAgentsSelectorConfig.md +++ b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointAllAgentsSelectorConfig.md @@ -7,7 +7,7 @@ Any agent selection object. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **agent_selector_type** | **str** | | -**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] ## Example diff --git a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointHttpServerBaseTest.md b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointHttpServerBaseTest.md index e89669416..ae15d68c6 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointHttpServerBaseTest.md +++ b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointHttpServerBaseTest.md @@ -7,13 +7,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] **has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] -**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] [default to 5000] **protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] -**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | [optional] **username** | **str** | Username for Basic/NTLM authentication. | [optional] **ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] **tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] -**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] [default to True] +**url** | **str** | The test target URL. | [optional] ## Example diff --git a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointHttpServerInstantTest.md b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointHttpServerInstantTest.md index 00af736e4..5c9970172 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointHttpServerInstantTest.md +++ b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointHttpServerInstantTest.md @@ -5,25 +5,26 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | +**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | [optional] **agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] -**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] -**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] **endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] -**max_machines** | **int** | Maximum number of agents which can execute the test. | -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] **test_name** | **str** | Name of the test. | **auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] **has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] -**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] [default to 5000] **protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] -**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | **username** | **str** | Username for Basic/NTLM authentication. | [optional] -**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] **tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] -**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | -**target_response_time** | **int** | Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red). | +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] [default to True] +**url** | **str** | The test target URL. You can optionally specify the protocol (`http` or `https`). - **Default Protocol:** If no protocol is specified, `https` is used by default. - **Port Number:** To specify a port, append it to the URL with a colon after the hostname or IP address (e.g., `https://example.com:443`). - If no port is specified in the URL, the `port` is determined by either the deprecated `port` field or the default protocol (HTTP: 80, HTTPS: 443). | +**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] +**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**target_response_time** | **int** | Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red). | [optional] [default to 1000] **password** | **str** | Password for Basic/NTLM authentication. | [optional] +**port** | **int** | **(Deprecated)** The port number to use for the test. It's recommended to specify the port directly in the `url` field instead. If this field is set, it will override the default protocol ports (HTTP: 80, HTTPS: 443) and any port specified in the `url`. | [optional] ## Example diff --git a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointHttpServerTest.md b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointHttpServerTest.md index 0a8702223..ef3a3c702 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointHttpServerTest.md +++ b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointHttpServerTest.md @@ -15,28 +15,24 @@ Name | Type | Description | Notes **has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] **modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] **protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] **server** | **str** | Target domain name or IP address. | [optional] **test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] **test_name** | **str** | Name of the test. | [optional] **type** | **str** | Type of test being queried. | [readonly] **tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] -**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**port** | **int** | Port number. | [optional] [default to 443] **auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] -**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] -**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] [default to 5000] **username** | **str** | Username for Basic/NTLM authentication. | [optional] **ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] -**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] -**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] [default to True] +**url** | **str** | The test target URL. | [optional] **follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] **http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] -**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] **ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] **use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] -**user_agent** | **str** | User-agent string to be provided during the test. | [optional] **labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointInstantTest.md b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointInstantTest.md index 4f1f0e279..151d3a2b9 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointInstantTest.md +++ b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointInstantTest.md @@ -5,13 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | +**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | [optional] **agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] -**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] -**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] **endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] -**max_machines** | **int** | Maximum number of agents which can execute the test. | -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] **test_name** | **str** | Name of the test. | ## Example diff --git a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointRunScheduledInstantTestResult.md b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointRunScheduledInstantTestResult.md new file mode 100644 index 000000000..112a95e70 --- /dev/null +++ b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointRunScheduledInstantTestResult.md @@ -0,0 +1,29 @@ +# EndpointRunScheduledInstantTestResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_run_scheduled_instant_test_result import EndpointRunScheduledInstantTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointRunScheduledInstantTestResult from a JSON string +endpoint_run_scheduled_instant_test_result_instance = EndpointRunScheduledInstantTestResult.from_json(json) +# print the JSON string representation of the object +print(EndpointRunScheduledInstantTestResult.to_json()) + +# convert the object into a dict +endpoint_run_scheduled_instant_test_result_dict = endpoint_run_scheduled_instant_test_result_instance.to_dict() +# create an instance of EndpointRunScheduledInstantTestResult from a dict +endpoint_run_scheduled_instant_test_result_from_dict = EndpointRunScheduledInstantTestResult.from_dict(endpoint_run_scheduled_instant_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointSpecificAgentsSelectorConfig.md b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointSpecificAgentsSelectorConfig.md index 674205b67..ea1e47f5e 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointSpecificAgentsSelectorConfig.md +++ b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointSpecificAgentsSelectorConfig.md @@ -7,7 +7,7 @@ Specific agents selection object. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **agent_selector_type** | **str** | | -**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] **agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] ## Example diff --git a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointTest.md b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointTest.md index 7e6ebd60f..18020bba9 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointTest.md +++ b/thousandeyes-sdk-endpoint-instant-tests/docs/EndpointTest.md @@ -15,14 +15,13 @@ Name | Type | Description | Notes **has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] **modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] **protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] **server** | **str** | Target domain name or IP address. | [optional] **test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] **test_name** | **str** | Name of the test. | [optional] **type** | [**EndpointScheduledTestType**](EndpointScheduledTestType.md) | | **tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] -**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**port** | **int** | Port number. | [optional] [default to 443] ## Example diff --git a/thousandeyes-sdk-endpoint-instant-tests/docs/HTTPServerEndpointInstantScheduledTestsApi.md b/thousandeyes-sdk-endpoint-instant-tests/docs/HTTPServerEndpointInstantScheduledTestsApi.md new file mode 100644 index 000000000..37c69a0c0 --- /dev/null +++ b/thousandeyes-sdk-endpoint-instant-tests/docs/HTTPServerEndpointInstantScheduledTestsApi.md @@ -0,0 +1,97 @@ +# thousandeyes_sdk.endpoint_instant_tests.HTTPServerEndpointInstantScheduledTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_http_server_scheduled_instant_test**](HTTPServerEndpointInstantScheduledTestsApi.md#create_http_server_scheduled_instant_test) | **POST** /endpoint/tests/scheduled-tests/http-server/instant | Run http server instant scheduled test + + +# **create_http_server_scheduled_instant_test** +> EndpointHttpServerTest create_http_server_scheduled_instant_test(endpoint_http_server_instant_test, aid=aid) + +Run http server instant scheduled test + +Creates and runs a new endpoint http server instant scheduled test in ThousandEyes. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_instant_tests +from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_http_server_instant_test import EndpointHttpServerInstantTest +from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_http_server_test import EndpointHttpServerTest +from thousandeyes_sdk.endpoint_instant_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_instant_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_instant_tests.HTTPServerEndpointInstantScheduledTestsApi(api_client) + endpoint_http_server_instant_test = thousandeyes_sdk.endpoint_instant_tests.EndpointHttpServerInstantTest() # EndpointHttpServerInstantTest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Run http server instant scheduled test + api_response = api_instance.create_http_server_scheduled_instant_test(endpoint_http_server_instant_test, aid=aid) + print("The response of HTTPServerEndpointInstantScheduledTestsApi->create_http_server_scheduled_instant_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPServerEndpointInstantScheduledTestsApi->create_http_server_scheduled_instant_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **endpoint_http_server_instant_test** | [**EndpointHttpServerInstantTest**](EndpointHttpServerInstantTest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointHttpServerTest**](EndpointHttpServerTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-endpoint-instant-tests/docs/RunEndpointInstantScheduledTestsApi.md b/thousandeyes-sdk-endpoint-instant-tests/docs/RunEndpointInstantScheduledTestsApi.md new file mode 100644 index 000000000..e63f3cdc4 --- /dev/null +++ b/thousandeyes-sdk-endpoint-instant-tests/docs/RunEndpointInstantScheduledTestsApi.md @@ -0,0 +1,94 @@ +# thousandeyes_sdk.endpoint_instant_tests.RunEndpointInstantScheduledTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**run_endpoint_scheduled_instant_test**](RunEndpointInstantScheduledTestsApi.md#run_endpoint_scheduled_instant_test) | **POST** /endpoint/tests/scheduled-tests/{testId}/run | Run endpoint instant scheduled test + + +# **run_endpoint_scheduled_instant_test** +> run_endpoint_scheduled_instant_test(test_id, aid=aid) + +Run endpoint instant scheduled test + +Runs an existing endpoint instant scheduled test in ThousandEyes. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_instant_tests +from thousandeyes_sdk.endpoint_instant_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_instant_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_instant_tests.RunEndpointInstantScheduledTestsApi(api_client) + test_id = '765231567' # str | ID of the endpoint instant scheduled test to rerun + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Run endpoint instant scheduled test + api_instance.run_endpoint_scheduled_instant_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling RunEndpointInstantScheduledTestsApi->run_endpoint_scheduled_instant_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| ID of the endpoint instant scheduled test to rerun | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully reran the instant scheduled test. | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/__init__.py b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/__init__.py index 7df1dbc15..bd9043126 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/__init__.py +++ b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/__init__.py @@ -14,16 +14,12 @@ # import apis into sdk package -from thousandeyes_sdk.endpoint_instant_tests.api.agent_to_server_instant_scheduled_test_api import AgentToServerInstantScheduledTestApi -from thousandeyes_sdk.endpoint_instant_tests.api.http_server_instant_scheduled_test_api import HttpServerInstantScheduledTestApi -from thousandeyes_sdk.endpoint_instant_tests.api.run_existing_test_api import RunExistingTestApi +from thousandeyes_sdk.endpoint_instant_tests.api.agent_to_server_endpoint_instant_scheduled_tests_api import AgentToServerEndpointInstantScheduledTestsApi +from thousandeyes_sdk.endpoint_instant_tests.api.http_server_endpoint_instant_scheduled_tests_api import HTTPServerEndpointInstantScheduledTestsApi +from thousandeyes_sdk.endpoint_instant_tests.api.run_endpoint_instant_scheduled_tests_api import RunEndpointInstantScheduledTestsApi # import models into sdk package -from thousandeyes_sdk.endpoint_instant_tests.models.alert_direction import AlertDirection -from thousandeyes_sdk.endpoint_instant_tests.models.alert_rounds_violation_mode import AlertRoundsViolationMode -from thousandeyes_sdk.endpoint_instant_tests.models.alert_rule import AlertRule -from thousandeyes_sdk.endpoint_instant_tests.models.alert_type import AlertType from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_agent_to_server_instant_test import EndpointAgentToServerInstantTest @@ -33,6 +29,7 @@ from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_http_server_instant_test import EndpointHttpServerInstantTest from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_http_server_test import EndpointHttpServerTest from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_instant_test import EndpointInstantTest +from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_run_scheduled_instant_test_result import EndpointRunScheduledInstantTestResult from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_scheduled_test_type import EndpointScheduledTestType from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_test import EndpointTest @@ -43,8 +40,6 @@ from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_test_self_link import EndpointTestSelfLink from thousandeyes_sdk.endpoint_instant_tests.models.error import Error from thousandeyes_sdk.endpoint_instant_tests.models.link import Link -from thousandeyes_sdk.endpoint_instant_tests.models.sensitivity_level import SensitivityLevel -from thousandeyes_sdk.endpoint_instant_tests.models.severity import Severity from thousandeyes_sdk.endpoint_instant_tests.models.test_interval import TestInterval from thousandeyes_sdk.endpoint_instant_tests.models.test_label import TestLabel from thousandeyes_sdk.endpoint_instant_tests.models.test_probe_mode_response import TestProbeModeResponse diff --git a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/api/__init__.py b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/api/__init__.py index 213c9ff52..02ab98cab 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/api/__init__.py +++ b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/api/__init__.py @@ -1,7 +1,7 @@ # flake8: noqa # import apis into api package -from thousandeyes_sdk.endpoint_instant_tests.api.agent_to_server_instant_scheduled_test_api import AgentToServerInstantScheduledTestApi -from thousandeyes_sdk.endpoint_instant_tests.api.http_server_instant_scheduled_test_api import HttpServerInstantScheduledTestApi -from thousandeyes_sdk.endpoint_instant_tests.api.run_existing_test_api import RunExistingTestApi +from thousandeyes_sdk.endpoint_instant_tests.api.agent_to_server_endpoint_instant_scheduled_tests_api import AgentToServerEndpointInstantScheduledTestsApi +from thousandeyes_sdk.endpoint_instant_tests.api.http_server_endpoint_instant_scheduled_tests_api import HTTPServerEndpointInstantScheduledTestsApi +from thousandeyes_sdk.endpoint_instant_tests.api.run_endpoint_instant_scheduled_tests_api import RunEndpointInstantScheduledTestsApi diff --git a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/api/agent_to_server_endpoint_instant_scheduled_tests_api.py b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/api/agent_to_server_endpoint_instant_scheduled_tests_api.py new file mode 100644 index 000000000..499485cdb --- /dev/null +++ b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/api/agent_to_server_endpoint_instant_scheduled_tests_api.py @@ -0,0 +1,353 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.endpoint_instant_tests.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_agent_to_server_instant_test import EndpointAgentToServerInstantTest +from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_agent_to_server_test import EndpointAgentToServerTest + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class AgentToServerEndpointInstantScheduledTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-endpoint-instant-tests")) + self.api_client = api_client + + + @validate_call + def create_agent_to_server_scheduled_instant_test( + self, + endpoint_agent_to_server_instant_test: EndpointAgentToServerInstantTest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EndpointAgentToServerTest: + """Run agent to server instant scheduled test + + Creates and runs a new endpoint agent to server instant scheduled test in ThousandEyes. + + :param endpoint_agent_to_server_instant_test: (required) + :type endpoint_agent_to_server_instant_test: EndpointAgentToServerInstantTest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_server_scheduled_instant_test_serialize( + endpoint_agent_to_server_instant_test=endpoint_agent_to_server_instant_test, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointAgentToServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_instant_tests.models, + ).data + + + @validate_call + def create_agent_to_server_scheduled_instant_test_with_http_info( + self, + endpoint_agent_to_server_instant_test: EndpointAgentToServerInstantTest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EndpointAgentToServerTest]: + """Run agent to server instant scheduled test + + Creates and runs a new endpoint agent to server instant scheduled test in ThousandEyes. + + :param endpoint_agent_to_server_instant_test: (required) + :type endpoint_agent_to_server_instant_test: EndpointAgentToServerInstantTest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_server_scheduled_instant_test_serialize( + endpoint_agent_to_server_instant_test=endpoint_agent_to_server_instant_test, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointAgentToServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_instant_tests.models, + ) + + + @validate_call + def create_agent_to_server_scheduled_instant_test_without_preload_content( + self, + endpoint_agent_to_server_instant_test: EndpointAgentToServerInstantTest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Run agent to server instant scheduled test + + Creates and runs a new endpoint agent to server instant scheduled test in ThousandEyes. + + :param endpoint_agent_to_server_instant_test: (required) + :type endpoint_agent_to_server_instant_test: EndpointAgentToServerInstantTest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_server_scheduled_instant_test_serialize( + endpoint_agent_to_server_instant_test=endpoint_agent_to_server_instant_test, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointAgentToServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_agent_to_server_scheduled_instant_test_serialize( + self, + endpoint_agent_to_server_instant_test, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if endpoint_agent_to_server_instant_test is not None: + _body_params = endpoint_agent_to_server_instant_test + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/tests/scheduled-tests/agent-to-server/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/api/http_server_endpoint_instant_scheduled_tests_api.py b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/api/http_server_endpoint_instant_scheduled_tests_api.py new file mode 100644 index 000000000..dbf314d4c --- /dev/null +++ b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/api/http_server_endpoint_instant_scheduled_tests_api.py @@ -0,0 +1,353 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.endpoint_instant_tests.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_http_server_instant_test import EndpointHttpServerInstantTest +from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_http_server_test import EndpointHttpServerTest + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class HTTPServerEndpointInstantScheduledTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-endpoint-instant-tests")) + self.api_client = api_client + + + @validate_call + def create_http_server_scheduled_instant_test( + self, + endpoint_http_server_instant_test: EndpointHttpServerInstantTest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EndpointHttpServerTest: + """Run http server instant scheduled test + + Creates and runs a new endpoint http server instant scheduled test in ThousandEyes. + + :param endpoint_http_server_instant_test: (required) + :type endpoint_http_server_instant_test: EndpointHttpServerInstantTest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_http_server_scheduled_instant_test_serialize( + endpoint_http_server_instant_test=endpoint_http_server_instant_test, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointHttpServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_instant_tests.models, + ).data + + + @validate_call + def create_http_server_scheduled_instant_test_with_http_info( + self, + endpoint_http_server_instant_test: EndpointHttpServerInstantTest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EndpointHttpServerTest]: + """Run http server instant scheduled test + + Creates and runs a new endpoint http server instant scheduled test in ThousandEyes. + + :param endpoint_http_server_instant_test: (required) + :type endpoint_http_server_instant_test: EndpointHttpServerInstantTest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_http_server_scheduled_instant_test_serialize( + endpoint_http_server_instant_test=endpoint_http_server_instant_test, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointHttpServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_instant_tests.models, + ) + + + @validate_call + def create_http_server_scheduled_instant_test_without_preload_content( + self, + endpoint_http_server_instant_test: EndpointHttpServerInstantTest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Run http server instant scheduled test + + Creates and runs a new endpoint http server instant scheduled test in ThousandEyes. + + :param endpoint_http_server_instant_test: (required) + :type endpoint_http_server_instant_test: EndpointHttpServerInstantTest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_http_server_scheduled_instant_test_serialize( + endpoint_http_server_instant_test=endpoint_http_server_instant_test, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointHttpServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_http_server_scheduled_instant_test_serialize( + self, + endpoint_http_server_instant_test, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if endpoint_http_server_instant_test is not None: + _body_params = endpoint_http_server_instant_test + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/tests/scheduled-tests/http-server/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/api/run_endpoint_instant_scheduled_tests_api.py b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/api/run_endpoint_instant_scheduled_tests_api.py new file mode 100644 index 000000000..31a9b57f2 --- /dev/null +++ b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/api/run_endpoint_instant_scheduled_tests_api.py @@ -0,0 +1,340 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.endpoint_instant_tests.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class RunEndpointInstantScheduledTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-endpoint-instant-tests")) + self.api_client = api_client + + + @validate_call + def run_endpoint_scheduled_instant_test( + self, + test_id: Annotated[StrictStr, Field(description="ID of the endpoint instant scheduled test to rerun")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Run endpoint instant scheduled test + + Runs an existing endpoint instant scheduled test in ThousandEyes. + + :param test_id: ID of the endpoint instant scheduled test to rerun (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._run_endpoint_scheduled_instant_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_instant_tests.models, + ).data + + + @validate_call + def run_endpoint_scheduled_instant_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="ID of the endpoint instant scheduled test to rerun")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Run endpoint instant scheduled test + + Runs an existing endpoint instant scheduled test in ThousandEyes. + + :param test_id: ID of the endpoint instant scheduled test to rerun (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._run_endpoint_scheduled_instant_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_instant_tests.models, + ) + + + @validate_call + def run_endpoint_scheduled_instant_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="ID of the endpoint instant scheduled test to rerun")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Run endpoint instant scheduled test + + Runs an existing endpoint instant scheduled test in ThousandEyes. + + :param test_id: ID of the endpoint instant scheduled test to rerun (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._run_endpoint_scheduled_instant_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _run_endpoint_scheduled_instant_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/tests/scheduled-tests/{testId}/run', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/__init__.py b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/__init__.py index 6f2dad6a2..4c82d9e90 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/__init__.py +++ b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/__init__.py @@ -13,10 +13,6 @@ # import models into model package -from thousandeyes_sdk.endpoint_instant_tests.models.alert_direction import AlertDirection -from thousandeyes_sdk.endpoint_instant_tests.models.alert_rounds_violation_mode import AlertRoundsViolationMode -from thousandeyes_sdk.endpoint_instant_tests.models.alert_rule import AlertRule -from thousandeyes_sdk.endpoint_instant_tests.models.alert_type import AlertType from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_agent_to_server_instant_test import EndpointAgentToServerInstantTest @@ -26,6 +22,7 @@ from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_http_server_instant_test import EndpointHttpServerInstantTest from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_http_server_test import EndpointHttpServerTest from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_instant_test import EndpointInstantTest +from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_run_scheduled_instant_test_result import EndpointRunScheduledInstantTestResult from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_scheduled_test_type import EndpointScheduledTestType from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_test import EndpointTest @@ -36,8 +33,6 @@ from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_test_self_link import EndpointTestSelfLink from thousandeyes_sdk.endpoint_instant_tests.models.error import Error from thousandeyes_sdk.endpoint_instant_tests.models.link import Link -from thousandeyes_sdk.endpoint_instant_tests.models.sensitivity_level import SensitivityLevel -from thousandeyes_sdk.endpoint_instant_tests.models.severity import Severity from thousandeyes_sdk.endpoint_instant_tests.models.test_interval import TestInterval from thousandeyes_sdk.endpoint_instant_tests.models.test_label import TestLabel from thousandeyes_sdk.endpoint_instant_tests.models.test_probe_mode_response import TestProbeModeResponse diff --git a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_agent_labels_selector_config.py b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_agent_labels_selector_config.py index 9d75131ca..93f5b89b4 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_agent_labels_selector_config.py +++ b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_agent_labels_selector_config.py @@ -27,7 +27,7 @@ class EndpointAgentLabelsSelectorConfig(BaseModel): Agent labels selection object. """ # noqa: E501 agent_selector_type: Annotated[str, Field(strict=True)] = Field(alias="agentSelectorType") - max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines", "endpointAgentLabels"] @@ -91,7 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "agentSelectorType": obj.get("agentSelectorType"), - "maxMachines": obj.get("maxMachines"), + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25, "endpointAgentLabels": obj.get("endpointAgentLabels") }) return _obj diff --git a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_agent_to_server_instant_test.py b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_agent_to_server_instant_test.py index 4905bc654..622ba240c 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_agent_to_server_instant_test.py +++ b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_agent_to_server_instant_test.py @@ -16,7 +16,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType @@ -27,16 +27,14 @@ class EndpointAgentToServerInstantTest(BaseModel): """ EndpointAgentToServerInstantTest """ # noqa: E501 - agent_selector_type: EndpointTestAgentSelectorType = Field(alias="agentSelectorType") + agent_selector_type: Optional[EndpointTestAgentSelectorType] = Field(default=None, alias="agentSelectorType") agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") - has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") - has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") - max_machines: Annotated[int, Field(le=50000, strict=True, ge=1)] = Field(description="Maximum number of agents which can execute the test.", alias="maxMachines") - port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") test_name: StrictStr = Field(description="Name of the test.", alias="testName") server_name: StrictStr = Field(description="A server address without a protocol or IP address.", alias="serverName") - __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "hasPing", "hasTraceroute", "endpointAgentLabels", "maxMachines", "port", "testName", "serverName"] + port: Optional[StrictInt] = Field(default=443, description="Port number.") + __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "endpointAgentLabels", "maxMachines", "testName", "serverName", "port"] model_config = ConfigDict( populate_by_name=True, @@ -92,13 +90,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "agentSelectorType": obj.get("agentSelectorType"), "agents": obj.get("agents"), - "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, - "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, "endpointAgentLabels": obj.get("endpointAgentLabels"), - "maxMachines": obj.get("maxMachines"), - "port": obj.get("port"), + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25, "testName": obj.get("testName"), - "serverName": obj.get("serverName") + "serverName": obj.get("serverName"), + "port": obj.get("port") if obj.get("port") is not None else 443 }) return _obj diff --git a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_agent_to_server_test.py b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_agent_to_server_test.py index 66f4662a2..38f8cdbfb 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_agent_to_server_test.py +++ b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_agent_to_server_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.endpoint_instant_tests.models.alert_rule import AlertRule from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_test_links import EndpointTestLinks from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_test_protocol import EndpointTestProtocol @@ -44,16 +43,15 @@ class EndpointAgentToServerTest(BaseModel): has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") - port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") protocol: Optional[EndpointTestProtocol] = None server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") type: Annotated[str, Field(strict=True)] = Field(description="Type of test being queried.") tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") - alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + port: Optional[StrictInt] = Field(default=443, description="Port number.") labels: Optional[List[TestLabel]] = None - __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "alertRules", "labels"] + __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "port", "labels"] @field_validator('type') def type_validate_regular_expression(cls, value): @@ -120,13 +118,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of agent_selector_config if self.agent_selector_config: _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) - _items = [] - if self.alert_rules: - for _item in self.alert_rules: - if _item: - _items.append(_item.to_dict()) - _dict['alertRules'] = _items # override the default output from pydantic by calling `to_dict()` of each item in labels (list) _items = [] if self.labels: @@ -156,14 +147,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "hasPathTraceInSession": obj.get("hasPathTraceInSession"), "modifiedDate": obj.get("modifiedDate"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, - "port": obj.get("port"), "protocol": obj.get("protocol"), "server": obj.get("server"), "testId": obj.get("testId"), "testName": obj.get("testName"), "type": obj.get("type"), "tcpProbeMode": obj.get("tcpProbeMode"), - "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "port": obj.get("port") if obj.get("port") is not None else 443, "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None }) return _obj diff --git a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_all_agents_selector_config.py b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_all_agents_selector_config.py index d2fa0a838..9125318ab 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_all_agents_selector_config.py +++ b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_all_agents_selector_config.py @@ -27,7 +27,7 @@ class EndpointAllAgentsSelectorConfig(BaseModel): Any agent selection object. """ # noqa: E501 agent_selector_type: Annotated[str, Field(strict=True)] = Field(alias="agentSelectorType") - max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines"] @field_validator('agent_selector_type') @@ -90,7 +90,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "agentSelectorType": obj.get("agentSelectorType"), - "maxMachines": obj.get("maxMachines") + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25 }) return _obj diff --git a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_http_server_base_test.py b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_http_server_base_test.py index 2478ed026..2cac50bac 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_http_server_base_test.py +++ b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_http_server_base_test.py @@ -31,14 +31,14 @@ class EndpointHttpServerBaseTest(BaseModel): """ # noqa: E501 auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") - http_time_limit: Optional[StrictInt] = Field(default=None, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") + http_time_limit: Optional[StrictInt] = Field(default=5000, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") protocol: Optional[EndpointTestProtocol] = None - url: Optional[StrictStr] = Field(default=None, description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") - verify_certificate: Optional[StrictBool] = Field(default=None, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") - __properties: ClassVar[List[str]] = ["authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "url", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate"] + verify_certificate: Optional[StrictBool] = Field(default=True, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + url: Optional[StrictStr] = Field(default=None, description="The test target URL.") + __properties: ClassVar[List[str]] = ["authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate", "url"] model_config = ConfigDict( populate_by_name=True, @@ -94,13 +94,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "authType": obj.get("authType"), "hasPathTraceInSession": obj.get("hasPathTraceInSession"), - "httpTimeLimit": obj.get("httpTimeLimit"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5000, "protocol": obj.get("protocol"), - "url": obj.get("url"), "username": obj.get("username"), "sslVersionId": obj.get("sslVersionId"), "tcpProbeMode": obj.get("tcpProbeMode"), - "verifyCertificate": obj.get("verifyCertificate") + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else True, + "url": obj.get("url") }) return _obj diff --git a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_http_server_instant_test.py b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_http_server_instant_test.py index 88b1d7a1a..72d586e3c 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_http_server_instant_test.py +++ b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_http_server_instant_test.py @@ -31,26 +31,27 @@ class EndpointHttpServerInstantTest(BaseModel): """ EndpointHttpServerInstantTest """ # noqa: E501 - agent_selector_type: EndpointTestAgentSelectorType = Field(alias="agentSelectorType") + agent_selector_type: Optional[EndpointTestAgentSelectorType] = Field(default=None, alias="agentSelectorType") agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") - has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") - has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") - max_machines: Annotated[int, Field(le=50000, strict=True, ge=1)] = Field(description="Maximum number of agents which can execute the test.", alias="maxMachines") - port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") test_name: StrictStr = Field(description="Name of the test.", alias="testName") auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") - http_time_limit: StrictInt = Field(description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") + http_time_limit: Optional[StrictInt] = Field(default=5000, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") protocol: Optional[EndpointTestProtocol] = None - url: StrictStr = Field(description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") - ssl_version_id: TestSslVersionId = Field(alias="sslVersionId") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") - verify_certificate: StrictBool = Field(description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") - target_response_time: StrictInt = Field(description="Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red).", alias="targetResponseTime") + verify_certificate: Optional[StrictBool] = Field(default=True, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + url: StrictStr = Field(description="The test target URL. You can optionally specify the protocol (`http` or `https`). - **Default Protocol:** If no protocol is specified, `https` is used by default. - **Port Number:** To specify a port, append it to the URL with a colon after the hostname or IP address (e.g., `https://example.com:443`). - If no port is specified in the URL, the `port` is determined by either the deprecated `port` field or the default protocol (HTTP: 80, HTTPS: 443). ") + has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") + has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + target_response_time: Optional[StrictInt] = Field(default=1000, description="Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red).", alias="targetResponseTime") password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") - __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "hasPing", "hasTraceroute", "endpointAgentLabels", "maxMachines", "port", "testName", "authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "url", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate", "targetResponseTime", "password"] + port: Optional[StrictInt] = Field(default=None, description="**(Deprecated)** The port number to use for the test. It's recommended to specify the port directly in the `url` field instead. If this field is set, it will override the default protocol ports (HTTP: 80, HTTPS: 443) and any port specified in the `url`. ") + __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "endpointAgentLabels", "maxMachines", "testName", "authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate", "url", "hasPing", "hasTraceroute", "networkMeasurements", "targetResponseTime", "password", "port"] model_config = ConfigDict( populate_by_name=True, @@ -106,23 +107,24 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "agentSelectorType": obj.get("agentSelectorType"), "agents": obj.get("agents"), - "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, - "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, "endpointAgentLabels": obj.get("endpointAgentLabels"), - "maxMachines": obj.get("maxMachines"), - "port": obj.get("port"), + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25, "testName": obj.get("testName"), "authType": obj.get("authType"), "hasPathTraceInSession": obj.get("hasPathTraceInSession"), - "httpTimeLimit": obj.get("httpTimeLimit"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5000, "protocol": obj.get("protocol"), - "url": obj.get("url"), "username": obj.get("username"), "sslVersionId": obj.get("sslVersionId"), "tcpProbeMode": obj.get("tcpProbeMode"), - "verifyCertificate": obj.get("verifyCertificate"), - "targetResponseTime": obj.get("targetResponseTime"), - "password": obj.get("password") + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else True, + "url": obj.get("url"), + "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, + "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "targetResponseTime": obj.get("targetResponseTime") if obj.get("targetResponseTime") is not None else 1000, + "password": obj.get("password"), + "port": obj.get("port") }) return _obj diff --git a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_http_server_test.py b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_http_server_test.py index 9261d9b7a..63447d728 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_http_server_test.py +++ b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_http_server_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.endpoint_instant_tests.models.alert_rule import AlertRule from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_test_auth_type import EndpointTestAuthType from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_test_links import EndpointTestLinks @@ -46,30 +45,26 @@ class EndpointHttpServerTest(BaseModel): has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") - port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") protocol: Optional[EndpointTestProtocol] = None server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") type: Annotated[str, Field(strict=True)] = Field(description="Type of test being queried.") tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") - alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + port: Optional[StrictInt] = Field(default=443, description="Port number.") auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") - http_time_limit: Optional[StrictInt] = Field(default=None, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") - url: Optional[StrictStr] = Field(default=None, description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") + http_time_limit: Optional[StrictInt] = Field(default=5000, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") - verify_certificate: Optional[StrictBool] = Field(default=None, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") - content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + verify_certificate: Optional[StrictBool] = Field(default=True, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + url: Optional[StrictStr] = Field(default=None, description="The test target URL.") follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") - post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") - user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") labels: Optional[List[TestLabel]] = None - __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "alertRules", "authType", "httpTimeLimit", "url", "username", "sslVersionId", "verifyCertificate", "contentRegex", "followRedirects", "httpTargetTime", "httpVersion", "postBody", "sslVersion", "useNtlm", "userAgent", "labels"] + __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "port", "authType", "httpTimeLimit", "username", "sslVersionId", "verifyCertificate", "url", "followRedirects", "httpTargetTime", "httpVersion", "sslVersion", "useNtlm", "labels"] @field_validator('type') def type_validate_regular_expression(cls, value): @@ -138,13 +133,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of agent_selector_config if self.agent_selector_config: _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) - _items = [] - if self.alert_rules: - for _item in self.alert_rules: - if _item: - _items.append(_item.to_dict()) - _dict['alertRules'] = _items # override the default output from pydantic by calling `to_dict()` of each item in labels (list) _items = [] if self.labels: @@ -174,28 +162,24 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "hasPathTraceInSession": obj.get("hasPathTraceInSession"), "modifiedDate": obj.get("modifiedDate"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, - "port": obj.get("port"), "protocol": obj.get("protocol"), "server": obj.get("server"), "testId": obj.get("testId"), "testName": obj.get("testName"), "type": obj.get("type"), "tcpProbeMode": obj.get("tcpProbeMode"), - "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "port": obj.get("port") if obj.get("port") is not None else 443, "authType": obj.get("authType"), - "httpTimeLimit": obj.get("httpTimeLimit"), - "url": obj.get("url"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5000, "username": obj.get("username"), "sslVersionId": obj.get("sslVersionId"), - "verifyCertificate": obj.get("verifyCertificate"), - "contentRegex": obj.get("contentRegex"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else True, + "url": obj.get("url"), "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, "httpTargetTime": obj.get("httpTargetTime"), "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, - "postBody": obj.get("postBody"), "sslVersion": obj.get("sslVersion"), "useNtlm": obj.get("useNtlm"), - "userAgent": obj.get("userAgent"), "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None }) return _obj diff --git a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_instant_test.py b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_instant_test.py index 28c449795..c8c25018f 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_instant_test.py +++ b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_instant_test.py @@ -16,7 +16,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType @@ -27,15 +27,12 @@ class EndpointInstantTest(BaseModel): """ EndpointInstantTest """ # noqa: E501 - agent_selector_type: EndpointTestAgentSelectorType = Field(alias="agentSelectorType") + agent_selector_type: Optional[EndpointTestAgentSelectorType] = Field(default=None, alias="agentSelectorType") agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") - has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") - has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") - max_machines: Annotated[int, Field(le=50000, strict=True, ge=1)] = Field(description="Maximum number of agents which can execute the test.", alias="maxMachines") - port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") test_name: StrictStr = Field(description="Name of the test.", alias="testName") - __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "hasPing", "hasTraceroute", "endpointAgentLabels", "maxMachines", "port", "testName"] + __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "endpointAgentLabels", "maxMachines", "testName"] model_config = ConfigDict( populate_by_name=True, @@ -91,11 +88,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "agentSelectorType": obj.get("agentSelectorType"), "agents": obj.get("agents"), - "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, - "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, "endpointAgentLabels": obj.get("endpointAgentLabels"), - "maxMachines": obj.get("maxMachines"), - "port": obj.get("port"), + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25, "testName": obj.get("testName") }) return _obj diff --git a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_run_scheduled_instant_test_result.py b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_run_scheduled_instant_test_result.py new file mode 100644 index 000000000..af2864849 --- /dev/null +++ b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_run_scheduled_instant_test_result.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class EndpointRunScheduledInstantTestResult(BaseModel): + """ + EndpointRunScheduledInstantTestResult + """ # noqa: E501 + message: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EndpointRunScheduledInstantTestResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EndpointRunScheduledInstantTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "message": obj.get("message") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_specific_agents_selector_config.py b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_specific_agents_selector_config.py index 0fdd88703..9f2834cf4 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_specific_agents_selector_config.py +++ b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_specific_agents_selector_config.py @@ -27,7 +27,7 @@ class EndpointSpecificAgentsSelectorConfig(BaseModel): Specific agents selection object. """ # noqa: E501 agent_selector_type: Annotated[str, Field(strict=True)] = Field(alias="agentSelectorType") - max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines", "agents"] @@ -91,7 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "agentSelectorType": obj.get("agentSelectorType"), - "maxMachines": obj.get("maxMachines"), + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25, "agents": obj.get("agents") }) return _obj diff --git a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_test.py b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_test.py index e3f1ce507..9c96cc355 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_test.py +++ b/thousandeyes-sdk-endpoint-instant-tests/src/thousandeyes_sdk/endpoint_instant_tests/models/endpoint_test.py @@ -19,7 +19,6 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.endpoint_instant_tests.models.alert_rule import AlertRule from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_scheduled_test_type import EndpointScheduledTestType from thousandeyes_sdk.endpoint_instant_tests.models.endpoint_test_links import EndpointTestLinks @@ -43,15 +42,14 @@ class EndpointTest(BaseModel): has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") - port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") protocol: Optional[EndpointTestProtocol] = None server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") type: EndpointScheduledTestType tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") - alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") - __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "alertRules"] + port: Optional[StrictInt] = Field(default=443, description="Port number.") + __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "port"] model_config = ConfigDict( populate_by_name=True, @@ -107,13 +105,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of agent_selector_config if self.agent_selector_config: _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) - _items = [] - if self.alert_rules: - for _item in self.alert_rules: - if _item: - _items.append(_item.to_dict()) - _dict['alertRules'] = _items return _dict @classmethod @@ -136,14 +127,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "hasPathTraceInSession": obj.get("hasPathTraceInSession"), "modifiedDate": obj.get("modifiedDate"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, - "port": obj.get("port"), "protocol": obj.get("protocol"), "server": obj.get("server"), "testId": obj.get("testId"), "testName": obj.get("testName"), "type": obj.get("type"), "tcpProbeMode": obj.get("tcpProbeMode"), - "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None + "port": obj.get("port") if obj.get("port") is not None else 443 }) return _obj diff --git a/thousandeyes-sdk-endpoint-instant-tests/test/test_agent_to_server_endpoint_instant_scheduled_tests_api.py b/thousandeyes-sdk-endpoint-instant-tests/test/test_agent_to_server_endpoint_instant_scheduled_tests_api.py new file mode 100644 index 000000000..78cd5088c --- /dev/null +++ b/thousandeyes-sdk-endpoint-instant-tests/test/test_agent_to_server_endpoint_instant_scheduled_tests_api.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.endpoint_instant_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.endpoint_instant_tests.api.agent_to_server_endpoint_instant_scheduled_tests_api import AgentToServerEndpointInstantScheduledTestsApi + + +class TestAgentToServerEndpointInstantScheduledTestsApi(unittest.TestCase): + """AgentToServerEndpointInstantScheduledTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = AgentToServerEndpointInstantScheduledTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_agent_to_server_scheduled_instant_test_models_validation(self) -> None: + """Test case for create_agent_to_server_scheduled_instant_test request and response models""" + request_body_json = """ + { + "port" : 443, + "agentSelectorType" : "all-agents", + "maxMachines" : 25, + "serverName" : "www.example.com", + "endpointAgentLabels" : [ "567", "214" ], + "agents" : [ "0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1", "66eec0f1-72b4-4755-aa83-3aed61d17f3c" ], + "testName" : "Test name" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_instant_tests.models.EndpointAgentToServerInstantTest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "server" : "www.example.com", + "isSavedEvent" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "type" : "agent-to-server", + "tcpProbeMode" : "auto", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_instant_tests.models.EndpointAgentToServerTest.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-endpoint-instant-tests/test/test_http_server_endpoint_instant_scheduled_tests_api.py b/thousandeyes-sdk-endpoint-instant-tests/test/test_http_server_endpoint_instant_scheduled_tests_api.py new file mode 100644 index 000000000..56b99568a --- /dev/null +++ b/thousandeyes-sdk-endpoint-instant-tests/test/test_http_server_endpoint_instant_scheduled_tests_api.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.endpoint_instant_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.endpoint_instant_tests.api.http_server_endpoint_instant_scheduled_tests_api import HTTPServerEndpointInstantScheduledTestsApi + + +class TestHTTPServerEndpointInstantScheduledTestsApi(unittest.TestCase): + """HTTPServerEndpointInstantScheduledTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = HTTPServerEndpointInstantScheduledTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_http_server_scheduled_instant_test_models_validation(self) -> None: + """Test case for create_http_server_scheduled_instant_test request and response models""" + request_body_json = """ + { + "verifyCertificate" : true, + "hasPing" : true, + "agentSelectorType" : "all-agents", + "maxMachines" : 25, + "httpTimeLimit" : 5000, + "networkMeasurements" : true, + "endpointAgentLabels" : [ "567", "214" ], + "tcpProbeMode" : "auto", + "url" : "url", + "agents" : [ "0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1", "66eec0f1-72b4-4755-aa83-3aed61d17f3c" ], + "protocol" : "icmp", + "password" : "password", + "port" : 443, + "hasTraceroute" : true, + "targetResponseTime" : 1000, + "authType" : "none", + "hasPathTraceInSession" : true, + "testName" : "Test name", + "username" : "username", + "sslVersionId" : "0" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_instant_tests.models.EndpointHttpServerInstantTest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "server" : "www.example.com", + "isSavedEvent" : false, + "sslVersion" : "Auto", + "useNtlm" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "httpTimeLimit" : 5000, + "type" : "http-server", + "protocol" : "icmp", + "httpVersion" : 2, + "followRedirects" : true, + "authType" : "none", + "testName" : "Test name", + "verifyCertificate" : true, + "networkMeasurements" : true, + "tcpProbeMode" : "auto", + "url" : "https://example.com:443", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "httpTargetTime" : 100, + "username" : "username", + "sslVersionId" : "0" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_instant_tests.models.EndpointHttpServerTest.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-endpoint-instant-tests/test/test_run_endpoint_instant_scheduled_tests_api.py b/thousandeyes-sdk-endpoint-instant-tests/test/test_run_endpoint_instant_scheduled_tests_api.py new file mode 100644 index 000000000..273a5f8ea --- /dev/null +++ b/thousandeyes-sdk-endpoint-instant-tests/test/test_run_endpoint_instant_scheduled_tests_api.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Endpoint Instant Scheduled Tests API + + You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.endpoint_instant_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.endpoint_instant_tests.api.run_endpoint_instant_scheduled_tests_api import RunEndpointInstantScheduledTestsApi + + +class TestRunEndpointInstantScheduledTestsApi(unittest.TestCase): + """RunEndpointInstantScheduledTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = RunEndpointInstantScheduledTestsApi() + + def tearDown(self) -> None: + pass + + def test_run_endpoint_scheduled_instant_test_models_validation(self) -> None: + """Test case for run_endpoint_scheduled_instant_test request and response models""" + + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-endpoint-labels/.openapi-generator/FILES b/thousandeyes-sdk-endpoint-labels/.openapi-generator/FILES index a8fd25e8a..f52a61d0f 100644 --- a/thousandeyes-sdk-endpoint-labels/.openapi-generator/FILES +++ b/thousandeyes-sdk-endpoint-labels/.openapi-generator/FILES @@ -1,8 +1,9 @@ .openapi-generator-ignore MANIFEST.in README.md +docs/EndpointAgentLabelsApi.md docs/Error.md -docs/Expand.md +docs/ExpandLabelOptions.md docs/Filter.md docs/FilterType.md docs/Label.md @@ -11,7 +12,6 @@ docs/LabelRequest.md docs/LabelResponse.md docs/Labels.md docs/Link.md -docs/ManageLabelsApi.md docs/MatchType.md docs/PaginationNextAndSelfLink.md docs/SelfLinks.md @@ -22,10 +22,10 @@ pyproject.toml setup.cfg src/thousandeyes_sdk/endpoint_labels/__init__.py src/thousandeyes_sdk/endpoint_labels/api/__init__.py -src/thousandeyes_sdk/endpoint_labels/api/manage_labels_api.py +src/thousandeyes_sdk/endpoint_labels/api/endpoint_agent_labels_api.py src/thousandeyes_sdk/endpoint_labels/models/__init__.py src/thousandeyes_sdk/endpoint_labels/models/error.py -src/thousandeyes_sdk/endpoint_labels/models/expand.py +src/thousandeyes_sdk/endpoint_labels/models/expand_label_options.py src/thousandeyes_sdk/endpoint_labels/models/filter.py src/thousandeyes_sdk/endpoint_labels/models/filter_type.py src/thousandeyes_sdk/endpoint_labels/models/label.py @@ -42,5 +42,5 @@ src/thousandeyes_sdk/endpoint_labels/models/validation_error.py src/thousandeyes_sdk/endpoint_labels/models/validation_error_item.py src/thousandeyes_sdk/endpoint_labels/py.typed test/__init__.py -test/test_manage_labels_api.py +test/test_endpoint_agent_labels_api.py test/test_utils.py diff --git a/thousandeyes-sdk-endpoint-labels/README.md b/thousandeyes-sdk-endpoint-labels/README.md index 65449549b..84f519de0 100644 --- a/thousandeyes-sdk-endpoint-labels/README.md +++ b/thousandeyes-sdk-endpoint-labels/README.md @@ -4,7 +4,7 @@ Manage labels applied to endpoint agents using this API. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -76,17 +76,17 @@ configuration = thousandeyes_sdk.core.Configuration( # Enter a context with an instance of the API client with thousandeyes_sdk.core.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.endpoint_labels.ManageLabelsApi(api_client) + api_instance = thousandeyes_sdk.endpoint_labels.EndpointAgentLabelsApi(api_client) aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) label_request = thousandeyes_sdk.endpoint_labels.LabelRequest() # LabelRequest | Label settings (optional) try: # Create label api_response = api_instance.create_endpoint_label(aid=aid, label_request=label_request) - print("The response of ManageLabelsApi->create_endpoint_label:\n") + print("The response of EndpointAgentLabelsApi->create_endpoint_label:\n") pprint(api_response) except ApiException as e: - print("Exception when calling ManageLabelsApi->create_endpoint_label: %s\n" % e) + print("Exception when calling EndpointAgentLabelsApi->create_endpoint_label: %s\n" % e) ``` @@ -96,17 +96,17 @@ All URIs are relative to *https://api.thousandeyes.com/v7* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*ManageLabelsApi* | [**create_endpoint_label**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-labels/docs/ManageLabelsApi.md#create_endpoint_label) | **POST** /endpoint/labels | Create label -*ManageLabelsApi* | [**delete_endpoint_label**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-labels/docs/ManageLabelsApi.md#delete_endpoint_label) | **DELETE** /endpoint/labels/{id} | Delete label -*ManageLabelsApi* | [**get_endpoint_label**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-labels/docs/ManageLabelsApi.md#get_endpoint_label) | **GET** /endpoint/labels/{id} | Retrieve label -*ManageLabelsApi* | [**get_endpoint_labels**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-labels/docs/ManageLabelsApi.md#get_endpoint_labels) | **GET** /endpoint/labels | List labels -*ManageLabelsApi* | [**update_endpoint_label**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-labels/docs/ManageLabelsApi.md#update_endpoint_label) | **PATCH** /endpoint/labels/{id} | Update label +*EndpointAgentLabelsApi* | [**create_endpoint_label**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-labels/docs/EndpointAgentLabelsApi.md#create_endpoint_label) | **POST** /endpoint/labels | Create label +*EndpointAgentLabelsApi* | [**delete_endpoint_label**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-labels/docs/EndpointAgentLabelsApi.md#delete_endpoint_label) | **DELETE** /endpoint/labels/{id} | Delete label +*EndpointAgentLabelsApi* | [**get_endpoint_label**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-labels/docs/EndpointAgentLabelsApi.md#get_endpoint_label) | **GET** /endpoint/labels/{id} | Retrieve label +*EndpointAgentLabelsApi* | [**get_endpoint_labels**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-labels/docs/EndpointAgentLabelsApi.md#get_endpoint_labels) | **GET** /endpoint/labels | List labels +*EndpointAgentLabelsApi* | [**update_endpoint_label**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-labels/docs/EndpointAgentLabelsApi.md#update_endpoint_label) | **PATCH** /endpoint/labels/{id} | Update label ## Documentation For Models - [Error](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-labels/docs/Error.md) - - [Expand](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-labels/docs/Expand.md) + - [ExpandLabelOptions](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-labels/docs/ExpandLabelOptions.md) - [Filter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-labels/docs/Filter.md) - [FilterType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-labels/docs/FilterType.md) - [Label](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-labels/docs/Label.md) diff --git a/thousandeyes-sdk-endpoint-labels/docs/EndpointAgentLabelsApi.md b/thousandeyes-sdk-endpoint-labels/docs/EndpointAgentLabelsApi.md new file mode 100644 index 000000000..518f943e3 --- /dev/null +++ b/thousandeyes-sdk-endpoint-labels/docs/EndpointAgentLabelsApi.md @@ -0,0 +1,442 @@ +# thousandeyes_sdk.endpoint_labels.EndpointAgentLabelsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_endpoint_label**](EndpointAgentLabelsApi.md#create_endpoint_label) | **POST** /endpoint/labels | Create label +[**delete_endpoint_label**](EndpointAgentLabelsApi.md#delete_endpoint_label) | **DELETE** /endpoint/labels/{id} | Delete label +[**get_endpoint_label**](EndpointAgentLabelsApi.md#get_endpoint_label) | **GET** /endpoint/labels/{id} | Retrieve label +[**get_endpoint_labels**](EndpointAgentLabelsApi.md#get_endpoint_labels) | **GET** /endpoint/labels | List labels +[**update_endpoint_label**](EndpointAgentLabelsApi.md#update_endpoint_label) | **PATCH** /endpoint/labels/{id} | Update label + + +# **create_endpoint_label** +> LabelResponse create_endpoint_label(aid=aid, label_request=label_request) + +Create label + +Creates a new label. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_labels +from thousandeyes_sdk.endpoint_labels.models.label_request import LabelRequest +from thousandeyes_sdk.endpoint_labels.models.label_response import LabelResponse +from thousandeyes_sdk.endpoint_labels.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_labels.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_labels.EndpointAgentLabelsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + label_request = thousandeyes_sdk.endpoint_labels.LabelRequest() # LabelRequest | Label settings (optional) + + try: + # Create label + api_response = api_instance.create_endpoint_label(aid=aid, label_request=label_request) + print("The response of EndpointAgentLabelsApi->create_endpoint_label:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointAgentLabelsApi->create_endpoint_label: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **label_request** | [**LabelRequest**](LabelRequest.md)| Label settings | [optional] + +### Return type + +[**LabelResponse**](LabelResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_endpoint_label** +> delete_endpoint_label(id, aid=aid) + +Delete label + +Deletes the label from your account. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_labels +from thousandeyes_sdk.endpoint_labels.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_labels.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_labels.EndpointAgentLabelsApi(api_client) + id = 'id_example' # str | The unique identifier of the label to operate on. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete label + api_instance.delete_endpoint_label(id, aid=aid) + except Exception as e: + print("Exception when calling EndpointAgentLabelsApi->delete_endpoint_label: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The unique identifier of the label to operate on. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_endpoint_label** +> LabelResponse get_endpoint_label(id, expand=expand, aid=aid) + +Retrieve label + +Returns a single label using its ID. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_labels +from thousandeyes_sdk.endpoint_labels.models.expand_label_options import ExpandLabelOptions +from thousandeyes_sdk.endpoint_labels.models.label_response import LabelResponse +from thousandeyes_sdk.endpoint_labels.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_labels.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_labels.EndpointAgentLabelsApi(api_client) + id = 'id_example' # str | The unique identifier of the label to operate on. + expand = [thousandeyes_sdk.endpoint_labels.ExpandLabelOptions()] # List[ExpandLabelOptions] | This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. (optional) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Retrieve label + api_response = api_instance.get_endpoint_label(id, expand=expand, aid=aid) + print("The response of EndpointAgentLabelsApi->get_endpoint_label:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointAgentLabelsApi->get_endpoint_label: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The unique identifier of the label to operate on. | + **expand** | [**List[ExpandLabelOptions]**](ExpandLabelOptions.md)| This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. | [optional] + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**LabelResponse**](LabelResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_endpoint_labels** +> Labels get_endpoint_labels(max=max, cursor=cursor, expand=expand, aid=aid) + +List labels + +Returns a list of labels. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_labels +from thousandeyes_sdk.endpoint_labels.models.expand_label_options import ExpandLabelOptions +from thousandeyes_sdk.endpoint_labels.models.labels import Labels +from thousandeyes_sdk.endpoint_labels.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_labels.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_labels.EndpointAgentLabelsApi(api_client) + max = 5 # int | (Optional) Maximum number of objects to return. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + expand = [thousandeyes_sdk.endpoint_labels.ExpandLabelOptions()] # List[ExpandLabelOptions] | This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. (optional) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List labels + api_response = api_instance.get_endpoint_labels(max=max, cursor=cursor, expand=expand, aid=aid) + print("The response of EndpointAgentLabelsApi->get_endpoint_labels:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointAgentLabelsApi->get_endpoint_labels: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **max** | **int**| (Optional) Maximum number of objects to return. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + **expand** | [**List[ExpandLabelOptions]**](ExpandLabelOptions.md)| This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. | [optional] + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**Labels**](Labels.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_endpoint_label** +> LabelResponse update_endpoint_label(id, aid=aid, label=label) + +Update label + +Updates a label using its ID. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_labels +from thousandeyes_sdk.endpoint_labels.models.label import Label +from thousandeyes_sdk.endpoint_labels.models.label_response import LabelResponse +from thousandeyes_sdk.endpoint_labels.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_labels.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_labels.EndpointAgentLabelsApi(api_client) + id = 'id_example' # str | The unique identifier of the label to operate on. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + label = thousandeyes_sdk.endpoint_labels.Label() # Label | Fields to change on the agent (optional) + + try: + # Update label + api_response = api_instance.update_endpoint_label(id, aid=aid, label=label) + print("The response of EndpointAgentLabelsApi->update_endpoint_label:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointAgentLabelsApi->update_endpoint_label: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The unique identifier of the label to operate on. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **label** | [**Label**](Label.md)| Fields to change on the agent | [optional] + +### Return type + +[**LabelResponse**](LabelResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-endpoint-labels/docs/ExpandLabelOptions.md b/thousandeyes-sdk-endpoint-labels/docs/ExpandLabelOptions.md new file mode 100644 index 000000000..e9e656dfb --- /dev/null +++ b/thousandeyes-sdk-endpoint-labels/docs/ExpandLabelOptions.md @@ -0,0 +1,11 @@ +# ExpandLabelOptions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/__init__.py b/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/__init__.py index 68b265511..07822ce70 100644 --- a/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/__init__.py +++ b/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/__init__.py @@ -14,12 +14,12 @@ # import apis into sdk package -from thousandeyes_sdk.endpoint_labels.api.manage_labels_api import ManageLabelsApi +from thousandeyes_sdk.endpoint_labels.api.endpoint_agent_labels_api import EndpointAgentLabelsApi # import models into sdk package from thousandeyes_sdk.endpoint_labels.models.error import Error -from thousandeyes_sdk.endpoint_labels.models.expand import Expand +from thousandeyes_sdk.endpoint_labels.models.expand_label_options import ExpandLabelOptions from thousandeyes_sdk.endpoint_labels.models.filter import Filter from thousandeyes_sdk.endpoint_labels.models.filter_type import FilterType from thousandeyes_sdk.endpoint_labels.models.label import Label diff --git a/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/api/__init__.py b/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/api/__init__.py index 2bea9711a..3d4ad9cb7 100644 --- a/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/api/__init__.py +++ b/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/api/__init__.py @@ -1,5 +1,5 @@ # flake8: noqa # import apis into api package -from thousandeyes_sdk.endpoint_labels.api.manage_labels_api import ManageLabelsApi +from thousandeyes_sdk.endpoint_labels.api.endpoint_agent_labels_api import EndpointAgentLabelsApi diff --git a/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/api/endpoint_agent_labels_api.py b/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/api/endpoint_agent_labels_api.py new file mode 100644 index 000000000..9f081ad42 --- /dev/null +++ b/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/api/endpoint_agent_labels_api.py @@ -0,0 +1,1596 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.endpoint_labels.models + +from pydantic import Field, StrictInt, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.endpoint_labels.models.expand_label_options import ExpandLabelOptions +from thousandeyes_sdk.endpoint_labels.models.label import Label +from thousandeyes_sdk.endpoint_labels.models.label_request import LabelRequest +from thousandeyes_sdk.endpoint_labels.models.label_response import LabelResponse +from thousandeyes_sdk.endpoint_labels.models.labels import Labels + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class EndpointAgentLabelsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-endpoint-labels")) + self.api_client = api_client + + + @validate_call + def create_endpoint_label( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + label_request: Annotated[Optional[LabelRequest], Field(description="Label settings")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LabelResponse: + """Create label + + Creates a new label. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param label_request: Label settings + :type label_request: LabelRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_endpoint_label_serialize( + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "LabelResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_labels.models, + ).data + + + @validate_call + def create_endpoint_label_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + label_request: Annotated[Optional[LabelRequest], Field(description="Label settings")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LabelResponse]: + """Create label + + Creates a new label. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param label_request: Label settings + :type label_request: LabelRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_endpoint_label_serialize( + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "LabelResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_labels.models, + ) + + + @validate_call + def create_endpoint_label_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + label_request: Annotated[Optional[LabelRequest], Field(description="Label settings")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create label + + Creates a new label. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param label_request: Label settings + :type label_request: LabelRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_endpoint_label_serialize( + aid=aid, + label_request=label_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "LabelResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_endpoint_label_serialize( + self, + aid, + label_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if label_request is not None: + _body_params = label_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/labels', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_endpoint_label( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete label + + Deletes the label from your account. + + :param id: The unique identifier of the label to operate on. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_endpoint_label_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_labels.models, + ).data + + + @validate_call + def delete_endpoint_label_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete label + + Deletes the label from your account. + + :param id: The unique identifier of the label to operate on. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_endpoint_label_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_labels.models, + ) + + + @validate_call + def delete_endpoint_label_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete label + + Deletes the label from your account. + + :param id: The unique identifier of the label to operate on. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_endpoint_label_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_endpoint_label_serialize( + self, + id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/endpoint/labels/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_endpoint_label( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + expand: Annotated[Optional[List[ExpandLabelOptions]], Field(description="This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times.")] = None, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LabelResponse: + """Retrieve label + + Returns a single label using its ID. + + :param id: The unique identifier of the label to operate on. (required) + :type id: str + :param expand: This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. + :type expand: List[ExpandLabelOptions] + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_label_serialize( + id=id, + expand=expand, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LabelResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_labels.models, + ).data + + + @validate_call + def get_endpoint_label_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + expand: Annotated[Optional[List[ExpandLabelOptions]], Field(description="This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times.")] = None, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LabelResponse]: + """Retrieve label + + Returns a single label using its ID. + + :param id: The unique identifier of the label to operate on. (required) + :type id: str + :param expand: This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. + :type expand: List[ExpandLabelOptions] + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_label_serialize( + id=id, + expand=expand, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LabelResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_labels.models, + ) + + + @validate_call + def get_endpoint_label_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + expand: Annotated[Optional[List[ExpandLabelOptions]], Field(description="This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times.")] = None, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve label + + Returns a single label using its ID. + + :param id: The unique identifier of the label to operate on. (required) + :type id: str + :param expand: This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. + :type expand: List[ExpandLabelOptions] + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_label_serialize( + id=id, + expand=expand, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LabelResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_endpoint_label_serialize( + self, + id, + expand, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if expand is not None: + + _query_params.append(('expand', expand)) + + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/labels/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_endpoint_labels( + self, + max: Annotated[Optional[StrictInt], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[ExpandLabelOptions]], Field(description="This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times.")] = None, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Labels: + """List labels + + Returns a list of labels. + + :param max: (Optional) Maximum number of objects to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. + :type expand: List[ExpandLabelOptions] + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_labels_serialize( + max=max, + cursor=cursor, + expand=expand, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Labels", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_labels.models, + ).data + + + @validate_call + def get_endpoint_labels_with_http_info( + self, + max: Annotated[Optional[StrictInt], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[ExpandLabelOptions]], Field(description="This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times.")] = None, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Labels]: + """List labels + + Returns a list of labels. + + :param max: (Optional) Maximum number of objects to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. + :type expand: List[ExpandLabelOptions] + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_labels_serialize( + max=max, + cursor=cursor, + expand=expand, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Labels", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_labels.models, + ) + + + @validate_call + def get_endpoint_labels_without_preload_content( + self, + max: Annotated[Optional[StrictInt], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[ExpandLabelOptions]], Field(description="This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times.")] = None, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List labels + + Returns a list of labels. + + :param max: (Optional) Maximum number of objects to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter is optional and determines whether to include additional details in the response. To specify multiple expansions, you can either separate the values with commas or specify the parameter multiple times. + :type expand: List[ExpandLabelOptions] + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_labels_serialize( + max=max, + cursor=cursor, + expand=expand, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Labels", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_endpoint_labels_serialize( + self, + max, + cursor, + expand, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if max is not None: + + _query_params.append(('max', max)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/labels', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_endpoint_label( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + label: Annotated[Optional[Label], Field(description="Fields to change on the agent")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LabelResponse: + """Update label + + Updates a label using its ID. + + :param id: The unique identifier of the label to operate on. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param label: Fields to change on the agent + :type label: Label + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_endpoint_label_serialize( + id=id, + aid=aid, + label=label, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LabelResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_labels.models, + ).data + + + @validate_call + def update_endpoint_label_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + label: Annotated[Optional[Label], Field(description="Fields to change on the agent")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LabelResponse]: + """Update label + + Updates a label using its ID. + + :param id: The unique identifier of the label to operate on. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param label: Fields to change on the agent + :type label: Label + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_endpoint_label_serialize( + id=id, + aid=aid, + label=label, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LabelResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_labels.models, + ) + + + @validate_call + def update_endpoint_label_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The unique identifier of the label to operate on.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + label: Annotated[Optional[Label], Field(description="Fields to change on the agent")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update label + + Updates a label using its ID. + + :param id: The unique identifier of the label to operate on. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param label: Fields to change on the agent + :type label: Label + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_endpoint_label_serialize( + id=id, + aid=aid, + label=label, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LabelResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_endpoint_label_serialize( + self, + id, + aid, + label, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if label is not None: + _body_params = label + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/endpoint/labels/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/models/__init__.py b/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/models/__init__.py index 643ec4fd9..0aca5afd2 100644 --- a/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/models/__init__.py +++ b/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/models/__init__.py @@ -14,7 +14,7 @@ # import models into model package from thousandeyes_sdk.endpoint_labels.models.error import Error -from thousandeyes_sdk.endpoint_labels.models.expand import Expand +from thousandeyes_sdk.endpoint_labels.models.expand_label_options import ExpandLabelOptions from thousandeyes_sdk.endpoint_labels.models.filter import Filter from thousandeyes_sdk.endpoint_labels.models.filter_type import FilterType from thousandeyes_sdk.endpoint_labels.models.label import Label diff --git a/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/models/expand_label_options.py b/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/models/expand_label_options.py new file mode 100644 index 000000000..728f88958 --- /dev/null +++ b/thousandeyes-sdk-endpoint-labels/src/thousandeyes_sdk/endpoint_labels/models/expand_label_options.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ExpandLabelOptions(str, Enum): + """ + ExpandLabelOptions + """ + + """ + allowed enum values + """ + FILTERS = 'filters' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ExpandLabelOptions from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-endpoint-labels/test/test_endpoint_agent_labels_api.py b/thousandeyes-sdk-endpoint-labels/test/test_endpoint_agent_labels_api.py new file mode 100644 index 000000000..adef3773d --- /dev/null +++ b/thousandeyes-sdk-endpoint-labels/test/test_endpoint_agent_labels_api.py @@ -0,0 +1,271 @@ +# coding: utf-8 + +""" + Endpoint Agent Labels API + + Manage labels applied to endpoint agents using this API. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.endpoint_labels.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.endpoint_labels.api.endpoint_agent_labels_api import EndpointAgentLabelsApi + + +class TestEndpointAgentLabelsApi(unittest.TestCase): + """EndpointAgentLabelsApi unit test stubs""" + + def setUp(self) -> None: + self.api = EndpointAgentLabelsApi() + + def tearDown(self) -> None: + pass + + def test_create_endpoint_label_models_validation(self) -> None: + """Test case for create_endpoint_label request and response models""" + request_body_json = """ + { + "color" : "#ff3333", + "matchType" : "and", + "name" : "Head office meeting rooms", + "id" : "abc-123-def", + "filters" : [ { + "mode" : "in", + "values" : [ "10.1.1.0/24", "192.168.1.0/24" ], + "key" : "vpn-client-network" + }, { + "mode" : "in", + "values" : [ "10.1.1.0/24", "192.168.1.0/24" ], + "key" : "vpn-client-network" + } ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_labels.models.LabelRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "color" : "#ff3333", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "matchType" : "and", + "name" : "Head office meeting rooms", + "id" : "abc-123-def", + "filters" : [ { + "mode" : "in", + "values" : [ "10.1.1.0/24", "192.168.1.0/24" ], + "key" : "vpn-client-network" + }, { + "mode" : "in", + "values" : [ "10.1.1.0/24", "192.168.1.0/24" ], + "key" : "vpn-client-network" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_labels.models.LabelResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_endpoint_label_models_validation(self) -> None: + """Test case for delete_endpoint_label request and response models""" + + + def test_get_endpoint_label_models_validation(self) -> None: + """Test case for get_endpoint_label request and response models""" + + response_body_json = """ + { + "color" : "#ff3333", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "matchType" : "and", + "name" : "Head office meeting rooms", + "id" : "abc-123-def", + "filters" : [ { + "mode" : "in", + "values" : [ "10.1.1.0/24", "192.168.1.0/24" ], + "key" : "vpn-client-network" + }, { + "mode" : "in", + "values" : [ "10.1.1.0/24", "192.168.1.0/24" ], + "key" : "vpn-client-network" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_labels.models.LabelResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_endpoint_labels_models_validation(self) -> None: + """Test case for get_endpoint_labels request and response models""" + + response_body_json = """ + { + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "labels" : [ { + "color" : "#ff3333", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "matchType" : "and", + "name" : "Head office meeting rooms", + "id" : "abc-123-def", + "filters" : [ { + "mode" : "in", + "values" : [ "10.1.1.0/24", "192.168.1.0/24" ], + "key" : "vpn-client-network" + }, { + "mode" : "in", + "values" : [ "10.1.1.0/24", "192.168.1.0/24" ], + "key" : "vpn-client-network" + } ] + }, { + "color" : "#ff3333", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "matchType" : "and", + "name" : "Head office meeting rooms", + "id" : "abc-123-def", + "filters" : [ { + "mode" : "in", + "values" : [ "10.1.1.0/24", "192.168.1.0/24" ], + "key" : "vpn-client-network" + }, { + "mode" : "in", + "values" : [ "10.1.1.0/24", "192.168.1.0/24" ], + "key" : "vpn-client-network" + } ] + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_labels.models.Labels.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_endpoint_label_models_validation(self) -> None: + """Test case for update_endpoint_label request and response models""" + request_body_json = """ + { + "color" : "#ff3333", + "matchType" : "and", + "name" : "Head office meeting rooms", + "id" : "abc-123-def", + "filters" : [ { + "mode" : "in", + "values" : [ "10.1.1.0/24", "192.168.1.0/24" ], + "key" : "vpn-client-network" + }, { + "mode" : "in", + "values" : [ "10.1.1.0/24", "192.168.1.0/24" ], + "key" : "vpn-client-network" + } ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_labels.models.Label.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "color" : "#ff3333", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "matchType" : "and", + "name" : "Head office meeting rooms", + "id" : "abc-123-def", + "filters" : [ { + "mode" : "in", + "values" : [ "10.1.1.0/24", "192.168.1.0/24" ], + "key" : "vpn-client-network" + }, { + "mode" : "in", + "values" : [ "10.1.1.0/24", "192.168.1.0/24" ], + "key" : "vpn-client-network" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_labels.models.LabelResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-endpoint-test-results/.openapi-generator/FILES b/thousandeyes-sdk-endpoint-test-results/.openapi-generator/FILES index f72d79e6e..31fcb051a 100644 --- a/thousandeyes-sdk-endpoint-test-results/.openapi-generator/FILES +++ b/thousandeyes-sdk-endpoint-test-results/.openapi-generator/FILES @@ -1,21 +1,17 @@ .openapi-generator-ignore MANIFEST.in README.md -docs/AlertDirection.md -docs/AlertRoundsViolationMode.md -docs/AlertRule.md -docs/AlertType.md docs/ApplicationScoreQuality.md docs/AsnDetails.md docs/ConditionalOperator.md docs/CpuUtilization.md -docs/DynamicBaseTestResult.md +docs/DynamicBaseEndpointTestResult.md +docs/DynamicEndpointTestWebex.md +docs/DynamicEndpointTestsDataRoundSearch.md +docs/DynamicEndpointTestsDataSearchFilter.md docs/DynamicTest.md docs/DynamicTestLinks.md docs/DynamicTestSelfLink.md -docs/DynamicTestWebex.md -docs/DynamicTestsDataRoundSearch.md -docs/DynamicTestsDataSearchFilter.md docs/EndpointAgentLabelsSelectorConfig.md docs/EndpointAgentSelectorConfig.md docs/EndpointAgentToServerTest.md @@ -26,96 +22,102 @@ docs/EndpointHttpServerBaseTest.md docs/EndpointHttpServerTest.md docs/EndpointNetworkTopologyResultRequest.md docs/EndpointNetworkTopologyResultRequestFilter.md +docs/EndpointPathTrace.md +docs/EndpointPathVisHop.md +docs/EndpointPathVisRoute.md docs/EndpointPingDataPointScore.md -docs/EndpointRealUserTest.md -docs/EndpointRealUserTestBase.md -docs/EndpointRealUserTestDetail.md -docs/EndpointRealUserTestDetailResults.md -docs/EndpointRealUserTestResultRequestFilter.md -docs/EndpointRealUserTestResults.md -docs/EndpointRealUserTestResultsRequest.md docs/EndpointResultRequestFilter.md docs/EndpointScheduledTest.md docs/EndpointScheduledTestType.md docs/EndpointSpecificAgentsSelectorConfig.md docs/EndpointTest.md docs/EndpointTestAuthType.md +docs/EndpointTestEthernetProfile.md docs/EndpointTestLinks.md docs/EndpointTestProtocol.md +docs/EndpointTestResult.md docs/EndpointTestResultProtocol.md docs/EndpointTestSelfLink.md +docs/EndpointTestsDataRoundsSearch.md +docs/EndpointTestsDataSearchFilter.md +docs/EndpointTestsDataSearchSort.md +docs/EndpointTestsDataSearchSortKey.md +docs/EndpointTestsDataThresholdFilter.md +docs/EndpointTestsDataThresholdFilters.md docs/Error.md -docs/EthernetProfile.md -docs/Expand.md +docs/ExpandEndpointHttpServerOptions.md docs/GatewayNetworkPing.md +docs/HTTPServerEndpointScheduledTestResultsApi.md docs/Hop.md +docs/HttpEndpointTestResult.md +docs/HttpEndpointTestResultHeaders.md +docs/HttpEndpointTestResults.md +docs/HttpEndpointTestsDataRoundsSearch.md +docs/HttpEndpointTestsDataSearchFilter.md +docs/HttpEndpointTestsDataSearchSort.md +docs/HttpEndpointTestsDataSearchSortKey.md +docs/HttpEndpointTestsDataThresholdFilter.md +docs/HttpEndpointTestsDataThresholdFilters.md docs/HttpErrorType.md -docs/HttpMultiTestResults.md -docs/HttpTestResult.md -docs/HttpTestResultHeaders.md -docs/HttpTestResults.md -docs/HttpTestsDataRoundsSearch.md -docs/HttpTestsDataSearchFilter.md -docs/HttpTestsDataSearchSort.md -docs/HttpTestsDataSearchSortKey.md -docs/HttpTestsDataThresholdFilter.md -docs/HttpTestsDataThresholdFilters.md +docs/HttpMultiEndpointTestResults.md docs/HttpThresholdFilterName.md docs/InterfaceHardwareType.md docs/Link.md +docs/LocalNetworkEndpointTestResultsApi.md docs/LocalNetworkResult.md docs/LocalNetworkResults.md -docs/LocalNetworkTestsResultsApi.md docs/LocalNetworkTopologyDetailResults.md docs/LocalNetworkTopologyResult.md docs/LocalNetworkTopologyResultBase.md docs/LocalNetworkTopologyResults.md -docs/MultiTestIdNetworkTestResults.md -docs/MultiTestIdTestsDataRoundsSearch.md -docs/MultiTestIdTestsDataSearchFilter.md -docs/NetworkDynamicTestResult.md -docs/NetworkDynamicTestResults.md -docs/NetworkDynamicTestsResultsApi.md +docs/MultiTestIdEndpointTestsDataRoundsSearch.md +docs/MultiTestIdEndpointTestsDataSearchFilter.md +docs/MultiTestIdNetworkEndpointTestResults.md +docs/NetworkDynamicEndpointTestResult.md +docs/NetworkDynamicEndpointTestResults.md +docs/NetworkDynamicEndpointTestResultsApi.md +docs/NetworkEndpointScheduledTestResultsApi.md +docs/NetworkEndpointTestResult.md +docs/NetworkEndpointTestResults.md docs/NetworkInterface.md docs/NetworkMetrics.md docs/NetworkPing.md docs/NetworkProfile.md docs/NetworkProxy.md docs/NetworkProxyProfile.md -docs/NetworkScheduledTestsResultsApi.md -docs/NetworkTestResult.md -docs/NetworkTestResults.md docs/NetworkTopologyType.md docs/NetworkWirelessProfile.md docs/PaginationNextAndSelfLink.md docs/PaginationNextLink.md -docs/PathVisBaseTestResult.md -docs/PathVisDetailDynamicTestResult.md -docs/PathVisDetailDynamicTestResults.md -docs/PathVisDetailTestResult.md -docs/PathVisDetailTestResults.md -docs/PathVisDynamicTestResult.md -docs/PathVisDynamicTestResults.md -docs/PathVisEndpoint.md -docs/PathVisHop.md -docs/PathVisRoute.md -docs/PathVisTestResult.md -docs/PathVisTestResults.md +docs/PathVisBaseEndpointTestResult.md +docs/PathVisDetailDynamicEndpointTestResult.md +docs/PathVisDetailDynamicEndpointTestResults.md +docs/PathVisDetailEndpointTestResult.md +docs/PathVisDetailEndpointTestResults.md +docs/PathVisDynamicEndpointTestResult.md +docs/PathVisDynamicEndpointTestResults.md +docs/PathVisEndpointTestResult.md +docs/PathVisEndpointTestResults.md docs/PhysicalMemoryUsedBytes.md docs/Platform.md -docs/RealUserTestCoordinates.md -docs/RealUserTestNetwork.md -docs/RealUserTestNetworkResult.md -docs/RealUserTestNetworkResults.md -docs/RealUserTestPage.md -docs/RealUserTestPageDetailResult.md -docs/RealUserTestPageResult.md -docs/RealUserTestPageResults.md -docs/RealUserTestPageTimings.md -docs/RealUserTestsResultsApi.md +docs/RealUserEndpointTest.md +docs/RealUserEndpointTestBase.md +docs/RealUserEndpointTestCoordinates.md +docs/RealUserEndpointTestDetail.md +docs/RealUserEndpointTestDetailResults.md +docs/RealUserEndpointTestNetwork.md +docs/RealUserEndpointTestNetworkResult.md +docs/RealUserEndpointTestNetworkResults.md +docs/RealUserEndpointTestPage.md +docs/RealUserEndpointTestPageDetailResult.md +docs/RealUserEndpointTestPageResult.md +docs/RealUserEndpointTestPageResults.md +docs/RealUserEndpointTestPageTimings.md +docs/RealUserEndpointTestResultRequestFilter.md +docs/RealUserEndpointTestResults.md +docs/RealUserEndpointTestResultsApi.md +docs/RealUserEndpointTestResultsRequest.md docs/SelfLinks.md -docs/SensitivityLevel.md -docs/Severity.md docs/SortOrder.md docs/SystemMetrics.md docs/TargetNetworkPing.md @@ -127,14 +129,7 @@ docs/TestInterval.md docs/TestLabel.md docs/TestProbeModeResponse.md docs/TestProtocol.md -docs/TestResult.md docs/TestSslVersionId.md -docs/TestsDataRoundsSearch.md -docs/TestsDataSearchFilter.md -docs/TestsDataSearchSort.md -docs/TestsDataSearchSortKey.md -docs/TestsDataThresholdFilter.md -docs/TestsDataThresholdFilters.md docs/ThresholdFilterName.md docs/ThresholdFilterOperator.md docs/Traceroute.md @@ -149,32 +144,27 @@ docs/VpnNetworkPing.md docs/VpnProfile.md docs/VpnTraceroute.md docs/VpnType.md -docs/WebHTTPServerScheduledTestResultsApi.md pyproject.toml setup.cfg src/thousandeyes_sdk/endpoint_test_results/__init__.py src/thousandeyes_sdk/endpoint_test_results/api/__init__.py -src/thousandeyes_sdk/endpoint_test_results/api/local_network_tests_results_api.py -src/thousandeyes_sdk/endpoint_test_results/api/network_dynamic_tests_results_api.py -src/thousandeyes_sdk/endpoint_test_results/api/network_scheduled_tests_results_api.py -src/thousandeyes_sdk/endpoint_test_results/api/real_user_tests_results_api.py -src/thousandeyes_sdk/endpoint_test_results/api/web_http_server_scheduled_test_results_api.py +src/thousandeyes_sdk/endpoint_test_results/api/http_server_endpoint_scheduled_test_results_api.py +src/thousandeyes_sdk/endpoint_test_results/api/local_network_endpoint_test_results_api.py +src/thousandeyes_sdk/endpoint_test_results/api/network_dynamic_endpoint_test_results_api.py +src/thousandeyes_sdk/endpoint_test_results/api/network_endpoint_scheduled_test_results_api.py +src/thousandeyes_sdk/endpoint_test_results/api/real_user_endpoint_test_results_api.py src/thousandeyes_sdk/endpoint_test_results/models/__init__.py -src/thousandeyes_sdk/endpoint_test_results/models/alert_direction.py -src/thousandeyes_sdk/endpoint_test_results/models/alert_rounds_violation_mode.py -src/thousandeyes_sdk/endpoint_test_results/models/alert_rule.py -src/thousandeyes_sdk/endpoint_test_results/models/alert_type.py src/thousandeyes_sdk/endpoint_test_results/models/application_score_quality.py src/thousandeyes_sdk/endpoint_test_results/models/asn_details.py src/thousandeyes_sdk/endpoint_test_results/models/conditional_operator.py src/thousandeyes_sdk/endpoint_test_results/models/cpu_utilization.py -src/thousandeyes_sdk/endpoint_test_results/models/dynamic_base_test_result.py +src/thousandeyes_sdk/endpoint_test_results/models/dynamic_base_endpoint_test_result.py +src/thousandeyes_sdk/endpoint_test_results/models/dynamic_endpoint_test_webex.py +src/thousandeyes_sdk/endpoint_test_results/models/dynamic_endpoint_tests_data_round_search.py +src/thousandeyes_sdk/endpoint_test_results/models/dynamic_endpoint_tests_data_search_filter.py src/thousandeyes_sdk/endpoint_test_results/models/dynamic_test.py src/thousandeyes_sdk/endpoint_test_results/models/dynamic_test_links.py src/thousandeyes_sdk/endpoint_test_results/models/dynamic_test_self_link.py -src/thousandeyes_sdk/endpoint_test_results/models/dynamic_test_webex.py -src/thousandeyes_sdk/endpoint_test_results/models/dynamic_tests_data_round_search.py -src/thousandeyes_sdk/endpoint_test_results/models/dynamic_tests_data_search_filter.py src/thousandeyes_sdk/endpoint_test_results/models/endpoint_agent_labels_selector_config.py src/thousandeyes_sdk/endpoint_test_results/models/endpoint_agent_selector_config.py src/thousandeyes_sdk/endpoint_test_results/models/endpoint_agent_to_server_test.py @@ -185,40 +175,43 @@ src/thousandeyes_sdk/endpoint_test_results/models/endpoint_http_server_base_test src/thousandeyes_sdk/endpoint_test_results/models/endpoint_http_server_test.py src/thousandeyes_sdk/endpoint_test_results/models/endpoint_network_topology_result_request.py src/thousandeyes_sdk/endpoint_test_results/models/endpoint_network_topology_result_request_filter.py +src/thousandeyes_sdk/endpoint_test_results/models/endpoint_path_trace.py +src/thousandeyes_sdk/endpoint_test_results/models/endpoint_path_vis_hop.py +src/thousandeyes_sdk/endpoint_test_results/models/endpoint_path_vis_route.py src/thousandeyes_sdk/endpoint_test_results/models/endpoint_ping_data_point_score.py -src/thousandeyes_sdk/endpoint_test_results/models/endpoint_real_user_test.py -src/thousandeyes_sdk/endpoint_test_results/models/endpoint_real_user_test_base.py -src/thousandeyes_sdk/endpoint_test_results/models/endpoint_real_user_test_detail.py -src/thousandeyes_sdk/endpoint_test_results/models/endpoint_real_user_test_detail_results.py -src/thousandeyes_sdk/endpoint_test_results/models/endpoint_real_user_test_result_request_filter.py -src/thousandeyes_sdk/endpoint_test_results/models/endpoint_real_user_test_results.py -src/thousandeyes_sdk/endpoint_test_results/models/endpoint_real_user_test_results_request.py src/thousandeyes_sdk/endpoint_test_results/models/endpoint_result_request_filter.py src/thousandeyes_sdk/endpoint_test_results/models/endpoint_scheduled_test.py src/thousandeyes_sdk/endpoint_test_results/models/endpoint_scheduled_test_type.py src/thousandeyes_sdk/endpoint_test_results/models/endpoint_specific_agents_selector_config.py src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test.py src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test_auth_type.py +src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test_ethernet_profile.py src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test_links.py src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test_protocol.py +src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test_result.py src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test_result_protocol.py src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test_self_link.py +src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_rounds_search.py +src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_search_filter.py +src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_search_sort.py +src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_search_sort_key.py +src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_threshold_filter.py +src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_threshold_filters.py src/thousandeyes_sdk/endpoint_test_results/models/error.py -src/thousandeyes_sdk/endpoint_test_results/models/ethernet_profile.py -src/thousandeyes_sdk/endpoint_test_results/models/expand.py +src/thousandeyes_sdk/endpoint_test_results/models/expand_endpoint_http_server_options.py src/thousandeyes_sdk/endpoint_test_results/models/gateway_network_ping.py src/thousandeyes_sdk/endpoint_test_results/models/hop.py +src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_test_result.py +src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_test_result_headers.py +src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_test_results.py +src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_rounds_search.py +src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_search_filter.py +src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_search_sort.py +src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_search_sort_key.py +src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_threshold_filter.py +src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_threshold_filters.py src/thousandeyes_sdk/endpoint_test_results/models/http_error_type.py -src/thousandeyes_sdk/endpoint_test_results/models/http_multi_test_results.py -src/thousandeyes_sdk/endpoint_test_results/models/http_test_result.py -src/thousandeyes_sdk/endpoint_test_results/models/http_test_result_headers.py -src/thousandeyes_sdk/endpoint_test_results/models/http_test_results.py -src/thousandeyes_sdk/endpoint_test_results/models/http_tests_data_rounds_search.py -src/thousandeyes_sdk/endpoint_test_results/models/http_tests_data_search_filter.py -src/thousandeyes_sdk/endpoint_test_results/models/http_tests_data_search_sort.py -src/thousandeyes_sdk/endpoint_test_results/models/http_tests_data_search_sort_key.py -src/thousandeyes_sdk/endpoint_test_results/models/http_tests_data_threshold_filter.py -src/thousandeyes_sdk/endpoint_test_results/models/http_tests_data_threshold_filters.py +src/thousandeyes_sdk/endpoint_test_results/models/http_multi_endpoint_test_results.py src/thousandeyes_sdk/endpoint_test_results/models/http_threshold_filter_name.py src/thousandeyes_sdk/endpoint_test_results/models/interface_hardware_type.py src/thousandeyes_sdk/endpoint_test_results/models/link.py @@ -228,49 +221,51 @@ src/thousandeyes_sdk/endpoint_test_results/models/local_network_topology_detail_ src/thousandeyes_sdk/endpoint_test_results/models/local_network_topology_result.py src/thousandeyes_sdk/endpoint_test_results/models/local_network_topology_result_base.py src/thousandeyes_sdk/endpoint_test_results/models/local_network_topology_results.py -src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_network_test_results.py -src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_tests_data_rounds_search.py -src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_tests_data_search_filter.py -src/thousandeyes_sdk/endpoint_test_results/models/network_dynamic_test_result.py -src/thousandeyes_sdk/endpoint_test_results/models/network_dynamic_test_results.py +src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_endpoint_tests_data_rounds_search.py +src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_endpoint_tests_data_search_filter.py +src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_network_endpoint_test_results.py +src/thousandeyes_sdk/endpoint_test_results/models/network_dynamic_endpoint_test_result.py +src/thousandeyes_sdk/endpoint_test_results/models/network_dynamic_endpoint_test_results.py +src/thousandeyes_sdk/endpoint_test_results/models/network_endpoint_test_result.py +src/thousandeyes_sdk/endpoint_test_results/models/network_endpoint_test_results.py src/thousandeyes_sdk/endpoint_test_results/models/network_interface.py src/thousandeyes_sdk/endpoint_test_results/models/network_metrics.py src/thousandeyes_sdk/endpoint_test_results/models/network_ping.py src/thousandeyes_sdk/endpoint_test_results/models/network_profile.py src/thousandeyes_sdk/endpoint_test_results/models/network_proxy.py src/thousandeyes_sdk/endpoint_test_results/models/network_proxy_profile.py -src/thousandeyes_sdk/endpoint_test_results/models/network_test_result.py -src/thousandeyes_sdk/endpoint_test_results/models/network_test_results.py src/thousandeyes_sdk/endpoint_test_results/models/network_topology_type.py src/thousandeyes_sdk/endpoint_test_results/models/network_wireless_profile.py src/thousandeyes_sdk/endpoint_test_results/models/pagination_next_and_self_link.py src/thousandeyes_sdk/endpoint_test_results/models/pagination_next_link.py -src/thousandeyes_sdk/endpoint_test_results/models/path_vis_base_test_result.py -src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_dynamic_test_result.py -src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_dynamic_test_results.py -src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_test_result.py -src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_test_results.py -src/thousandeyes_sdk/endpoint_test_results/models/path_vis_dynamic_test_result.py -src/thousandeyes_sdk/endpoint_test_results/models/path_vis_dynamic_test_results.py -src/thousandeyes_sdk/endpoint_test_results/models/path_vis_endpoint.py -src/thousandeyes_sdk/endpoint_test_results/models/path_vis_hop.py -src/thousandeyes_sdk/endpoint_test_results/models/path_vis_route.py -src/thousandeyes_sdk/endpoint_test_results/models/path_vis_test_result.py -src/thousandeyes_sdk/endpoint_test_results/models/path_vis_test_results.py +src/thousandeyes_sdk/endpoint_test_results/models/path_vis_base_endpoint_test_result.py +src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_dynamic_endpoint_test_result.py +src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_dynamic_endpoint_test_results.py +src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_endpoint_test_result.py +src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_endpoint_test_results.py +src/thousandeyes_sdk/endpoint_test_results/models/path_vis_dynamic_endpoint_test_result.py +src/thousandeyes_sdk/endpoint_test_results/models/path_vis_dynamic_endpoint_test_results.py +src/thousandeyes_sdk/endpoint_test_results/models/path_vis_endpoint_test_result.py +src/thousandeyes_sdk/endpoint_test_results/models/path_vis_endpoint_test_results.py src/thousandeyes_sdk/endpoint_test_results/models/physical_memory_used_bytes.py src/thousandeyes_sdk/endpoint_test_results/models/platform.py -src/thousandeyes_sdk/endpoint_test_results/models/real_user_test_coordinates.py -src/thousandeyes_sdk/endpoint_test_results/models/real_user_test_network.py -src/thousandeyes_sdk/endpoint_test_results/models/real_user_test_network_result.py -src/thousandeyes_sdk/endpoint_test_results/models/real_user_test_network_results.py -src/thousandeyes_sdk/endpoint_test_results/models/real_user_test_page.py -src/thousandeyes_sdk/endpoint_test_results/models/real_user_test_page_detail_result.py -src/thousandeyes_sdk/endpoint_test_results/models/real_user_test_page_result.py -src/thousandeyes_sdk/endpoint_test_results/models/real_user_test_page_results.py -src/thousandeyes_sdk/endpoint_test_results/models/real_user_test_page_timings.py +src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test.py +src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_base.py +src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_coordinates.py +src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_detail.py +src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_detail_results.py +src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_network.py +src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_network_result.py +src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_network_results.py +src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page.py +src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_detail_result.py +src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_result.py +src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_results.py +src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_timings.py +src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_result_request_filter.py +src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_results.py +src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_results_request.py src/thousandeyes_sdk/endpoint_test_results/models/self_links.py -src/thousandeyes_sdk/endpoint_test_results/models/sensitivity_level.py -src/thousandeyes_sdk/endpoint_test_results/models/severity.py src/thousandeyes_sdk/endpoint_test_results/models/sort_order.py src/thousandeyes_sdk/endpoint_test_results/models/system_metrics.py src/thousandeyes_sdk/endpoint_test_results/models/target_network_ping.py @@ -282,14 +277,7 @@ src/thousandeyes_sdk/endpoint_test_results/models/test_interval.py src/thousandeyes_sdk/endpoint_test_results/models/test_label.py src/thousandeyes_sdk/endpoint_test_results/models/test_probe_mode_response.py src/thousandeyes_sdk/endpoint_test_results/models/test_protocol.py -src/thousandeyes_sdk/endpoint_test_results/models/test_result.py src/thousandeyes_sdk/endpoint_test_results/models/test_ssl_version_id.py -src/thousandeyes_sdk/endpoint_test_results/models/tests_data_rounds_search.py -src/thousandeyes_sdk/endpoint_test_results/models/tests_data_search_filter.py -src/thousandeyes_sdk/endpoint_test_results/models/tests_data_search_sort.py -src/thousandeyes_sdk/endpoint_test_results/models/tests_data_search_sort_key.py -src/thousandeyes_sdk/endpoint_test_results/models/tests_data_threshold_filter.py -src/thousandeyes_sdk/endpoint_test_results/models/tests_data_threshold_filters.py src/thousandeyes_sdk/endpoint_test_results/models/threshold_filter_name.py src/thousandeyes_sdk/endpoint_test_results/models/threshold_filter_operator.py src/thousandeyes_sdk/endpoint_test_results/models/traceroute.py @@ -306,9 +294,9 @@ src/thousandeyes_sdk/endpoint_test_results/models/vpn_traceroute.py src/thousandeyes_sdk/endpoint_test_results/models/vpn_type.py src/thousandeyes_sdk/endpoint_test_results/py.typed test/__init__.py -test/test_local_network_tests_results_api.py -test/test_network_dynamic_tests_results_api.py -test/test_network_scheduled_tests_results_api.py -test/test_real_user_tests_results_api.py +test/test_http_server_endpoint_scheduled_test_results_api.py +test/test_local_network_endpoint_test_results_api.py +test/test_network_dynamic_endpoint_test_results_api.py +test/test_network_endpoint_scheduled_test_results_api.py +test/test_real_user_endpoint_test_results_api.py test/test_utils.py -test/test_web_http_server_scheduled_test_results_api.py diff --git a/thousandeyes-sdk-endpoint-test-results/README.md b/thousandeyes-sdk-endpoint-test-results/README.md index 7c2d67bd0..e6e21032a 100644 --- a/thousandeyes-sdk-endpoint-test-results/README.md +++ b/thousandeyes-sdk-endpoint-test-results/README.md @@ -3,7 +3,7 @@ Retrieve results for scheduled and dynamic tests on endpoint agents. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -75,21 +75,22 @@ configuration = thousandeyes_sdk.core.Configuration( # Enter a context with an instance of the API client with thousandeyes_sdk.core.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.endpoint_test_results.LocalNetworkTestsResultsApi(api_client) + api_instance = thousandeyes_sdk.endpoint_test_results.HTTPServerEndpointScheduledTestResultsApi(api_client) + test_id = '202701' # str | Test ID aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) - endpoint_network_topology_result_request = thousandeyes_sdk.endpoint_test_results.EndpointNetworkTopologyResultRequest() # EndpointNetworkTopologyResultRequest | (optional) + expand = [thousandeyes_sdk.endpoint_test_results.ExpandEndpointHttpServerOptions()] # List[ExpandEndpointHttpServerOptions] | This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query. (optional) try: - # List endpoint network topologies probes - api_response = api_instance.filter_local_networks_test_results_topologies(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, endpoint_network_topology_result_request=endpoint_network_topology_result_request) - print("The response of LocalNetworkTestsResultsApi->filter_local_networks_test_results_topologies:\n") + # Retrieve HTTP server scheduled test results + api_response = api_instance.get_http_server_scheduled_test_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, expand=expand) + print("The response of HTTPServerEndpointScheduledTestResultsApi->get_http_server_scheduled_test_results:\n") pprint(api_response) except ApiException as e: - print("Exception when calling LocalNetworkTestsResultsApi->filter_local_networks_test_results_topologies: %s\n" % e) + print("Exception when calling HTTPServerEndpointScheduledTestResultsApi->get_http_server_scheduled_test_results: %s\n" % e) ``` @@ -99,42 +100,38 @@ All URIs are relative to *https://api.thousandeyes.com/v7* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*LocalNetworkTestsResultsApi* | [**filter_local_networks_test_results_topologies**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/LocalNetworkTestsResultsApi.md#filter_local_networks_test_results_topologies) | **POST** /endpoint/test-results/local-networks/topologies/filter | List endpoint network topologies probes -*LocalNetworkTestsResultsApi* | [**get_local_networks_test_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/LocalNetworkTestsResultsApi.md#get_local_networks_test_results) | **GET** /endpoint/test-results/local-networks | List local networks -*LocalNetworkTestsResultsApi* | [**get_local_networks_test_results_topology**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/LocalNetworkTestsResultsApi.md#get_local_networks_test_results_topology) | **GET** /endpoint/test-results/local-networks/topologies/{networkTopologyId} | Retrieve endpoint local network topology -*NetworkDynamicTestsResultsApi* | [**filter_dynamic_test_network_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicTestsResultsApi.md#filter_dynamic_test_network_results) | **POST** /endpoint/test-results/dynamic-tests/{testId}/network/filter | Retrieve network dynamic test results -*NetworkDynamicTestsResultsApi* | [**get_dynamic_test_path_vis_agent_round_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicTestsResultsApi.md#get_dynamic_test_path_vis_agent_round_results) | **GET** /endpoint/test-results/dynamic-tests/{testId}/path-vis/agent/{agentId}/round/{roundId} | Retrieve path visualization network dynamic test results details -*NetworkDynamicTestsResultsApi* | [**get_dynamic_test_path_vis_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicTestsResultsApi.md#get_dynamic_test_path_vis_results) | **GET** /endpoint/test-results/dynamic-tests/{testId}/path-vis | Retrieve path visualization network dynamic test results -*NetworkScheduledTestsResultsApi* | [**filter_scheduled_test_network_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkScheduledTestsResultsApi.md#filter_scheduled_test_network_results) | **POST** /endpoint/test-results/scheduled-tests/{testId}/network/filter | Retrieve network scheduled test results -*NetworkScheduledTestsResultsApi* | [**filter_scheduled_tests_network_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkScheduledTestsResultsApi.md#filter_scheduled_tests_network_results) | **POST** /endpoint/test-results/scheduled-tests/network/filter | Retrieve network scheduled test results from multiple tests -*NetworkScheduledTestsResultsApi* | [**get_scheduled_test_path_vis_agent_round_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkScheduledTestsResultsApi.md#get_scheduled_test_path_vis_agent_round_results) | **GET** /endpoint/test-results/scheduled-tests/{testId}/path-vis/agent/{agentId}/round/{roundId} | Retrieve path visualization network scheduled test results details -*NetworkScheduledTestsResultsApi* | [**get_scheduled_test_path_vis_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkScheduledTestsResultsApi.md#get_scheduled_test_path_vis_results) | **GET** /endpoint/test-results/scheduled-tests/{testId}/path-vis | Retrieve path visualization network scheduled test results -*RealUserTestsResultsApi* | [**filter_real_user_tests_network_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserTestsResultsApi.md#filter_real_user_tests_network_results) | **POST** /endpoint/test-results/real-user-tests/networks/filter | List endpoint real user tests -*RealUserTestsResultsApi* | [**filter_real_user_tests_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserTestsResultsApi.md#filter_real_user_tests_results) | **POST** /endpoint/test-results/real-user-tests/filter | List endpoint real user tests -*RealUserTestsResultsApi* | [**filter_real_user_tests_visited_pages_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserTestsResultsApi.md#filter_real_user_tests_visited_pages_results) | **POST** /endpoint/test-results/real-user-tests/pages/filter | List endpoint real user tests visited pages -*RealUserTestsResultsApi* | [**get_real_user_test_page_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserTestsResultsApi.md#get_real_user_test_page_results) | **GET** /endpoint/test-results/real-user-tests/{id}/pages/{pageId} | Retrieve endpoint real user test page -*RealUserTestsResultsApi* | [**get_real_user_test_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserTestsResultsApi.md#get_real_user_test_results) | **GET** /endpoint/test-results/real-user-tests/{id} | Retrieve endpoint real user test -*WebHTTPServerScheduledTestResultsApi* | [**get_http_server_scheduled_test_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/WebHTTPServerScheduledTestResultsApi.md#get_http_server_scheduled_test_results) | **GET** /endpoint/test-results/scheduled-tests/{testId}/http-server | Retrieve HTTP server scheduled test results -*WebHTTPServerScheduledTestResultsApi* | [**get_multi_test_filtered_http_server_scheduled_test_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/WebHTTPServerScheduledTestResultsApi.md#get_multi_test_filtered_http_server_scheduled_test_results) | **POST** /endpoint/test-results/scheduled-tests/http-server/filter | Filter HTTP server scheduled test results +*HTTPServerEndpointScheduledTestResultsApi* | [**get_http_server_scheduled_test_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HTTPServerEndpointScheduledTestResultsApi.md#get_http_server_scheduled_test_results) | **GET** /endpoint/test-results/scheduled-tests/{testId}/http-server | Retrieve HTTP server scheduled test results +*HTTPServerEndpointScheduledTestResultsApi* | [**get_multi_test_filtered_http_server_scheduled_test_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HTTPServerEndpointScheduledTestResultsApi.md#get_multi_test_filtered_http_server_scheduled_test_results) | **POST** /endpoint/test-results/scheduled-tests/http-server/filter | Filter HTTP server scheduled test results +*LocalNetworkEndpointTestResultsApi* | [**filter_local_networks_test_results_topologies**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/LocalNetworkEndpointTestResultsApi.md#filter_local_networks_test_results_topologies) | **POST** /endpoint/test-results/local-networks/topologies/filter | List endpoint network topologies probes +*LocalNetworkEndpointTestResultsApi* | [**get_local_networks_test_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/LocalNetworkEndpointTestResultsApi.md#get_local_networks_test_results) | **GET** /endpoint/test-results/local-networks | List local networks +*LocalNetworkEndpointTestResultsApi* | [**get_local_networks_test_results_topology**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/LocalNetworkEndpointTestResultsApi.md#get_local_networks_test_results_topology) | **GET** /endpoint/test-results/local-networks/topologies/{networkTopologyId} | Retrieve endpoint local network topology +*NetworkDynamicEndpointTestResultsApi* | [**filter_dynamic_test_network_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicEndpointTestResultsApi.md#filter_dynamic_test_network_results) | **POST** /endpoint/test-results/dynamic-tests/{testId}/network/filter | Retrieve network dynamic test results +*NetworkDynamicEndpointTestResultsApi* | [**get_dynamic_test_path_vis_agent_round_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicEndpointTestResultsApi.md#get_dynamic_test_path_vis_agent_round_results) | **GET** /endpoint/test-results/dynamic-tests/{testId}/path-vis/agent/{agentId}/round/{roundId} | Retrieve path visualization network dynamic test results details +*NetworkDynamicEndpointTestResultsApi* | [**get_dynamic_test_path_vis_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicEndpointTestResultsApi.md#get_dynamic_test_path_vis_results) | **GET** /endpoint/test-results/dynamic-tests/{testId}/path-vis | Retrieve path visualization network dynamic test results +*NetworkEndpointScheduledTestResultsApi* | [**filter_scheduled_test_network_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointScheduledTestResultsApi.md#filter_scheduled_test_network_results) | **POST** /endpoint/test-results/scheduled-tests/{testId}/network/filter | Retrieve network scheduled test results +*NetworkEndpointScheduledTestResultsApi* | [**filter_scheduled_tests_network_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointScheduledTestResultsApi.md#filter_scheduled_tests_network_results) | **POST** /endpoint/test-results/scheduled-tests/network/filter | Retrieve network scheduled test results from multiple tests +*NetworkEndpointScheduledTestResultsApi* | [**get_scheduled_test_path_vis_agent_round_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointScheduledTestResultsApi.md#get_scheduled_test_path_vis_agent_round_results) | **GET** /endpoint/test-results/scheduled-tests/{testId}/path-vis/agent/{agentId}/round/{roundId} | Retrieve path visualization network scheduled test results details +*NetworkEndpointScheduledTestResultsApi* | [**get_scheduled_test_path_vis_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointScheduledTestResultsApi.md#get_scheduled_test_path_vis_results) | **GET** /endpoint/test-results/scheduled-tests/{testId}/path-vis | Retrieve path visualization network scheduled test results +*RealUserEndpointTestResultsApi* | [**filter_real_user_tests_network_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultsApi.md#filter_real_user_tests_network_results) | **POST** /endpoint/test-results/real-user-tests/networks/filter | List endpoint real user tests +*RealUserEndpointTestResultsApi* | [**filter_real_user_tests_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultsApi.md#filter_real_user_tests_results) | **POST** /endpoint/test-results/real-user-tests/filter | List endpoint real user tests +*RealUserEndpointTestResultsApi* | [**filter_real_user_tests_visited_pages_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultsApi.md#filter_real_user_tests_visited_pages_results) | **POST** /endpoint/test-results/real-user-tests/pages/filter | List endpoint real user tests visited pages +*RealUserEndpointTestResultsApi* | [**get_real_user_test_page_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultsApi.md#get_real_user_test_page_results) | **GET** /endpoint/test-results/real-user-tests/{id}/pages/{pageId} | Retrieve endpoint real user test page +*RealUserEndpointTestResultsApi* | [**get_real_user_test_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultsApi.md#get_real_user_test_results) | **GET** /endpoint/test-results/real-user-tests/{id} | Retrieve endpoint real user test ## Documentation For Models - - [AlertDirection](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/AlertDirection.md) - - [AlertRoundsViolationMode](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/AlertRoundsViolationMode.md) - - [AlertRule](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/AlertRule.md) - - [AlertType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/AlertType.md) - [ApplicationScoreQuality](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/ApplicationScoreQuality.md) - [AsnDetails](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/AsnDetails.md) - [ConditionalOperator](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/ConditionalOperator.md) - [CpuUtilization](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/CpuUtilization.md) - - [DynamicBaseTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/DynamicBaseTestResult.md) + - [DynamicBaseEndpointTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/DynamicBaseEndpointTestResult.md) + - [DynamicEndpointTestWebex](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/DynamicEndpointTestWebex.md) + - [DynamicEndpointTestsDataRoundSearch](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/DynamicEndpointTestsDataRoundSearch.md) + - [DynamicEndpointTestsDataSearchFilter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/DynamicEndpointTestsDataSearchFilter.md) - [DynamicTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/DynamicTest.md) - [DynamicTestLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/DynamicTestLinks.md) - [DynamicTestSelfLink](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/DynamicTestSelfLink.md) - - [DynamicTestWebex](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/DynamicTestWebex.md) - - [DynamicTestsDataRoundSearch](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/DynamicTestsDataRoundSearch.md) - - [DynamicTestsDataSearchFilter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/DynamicTestsDataSearchFilter.md) - [EndpointAgentLabelsSelectorConfig](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointAgentLabelsSelectorConfig.md) - [EndpointAgentSelectorConfig](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointAgentSelectorConfig.md) - [EndpointAgentToServerTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointAgentToServerTest.md) @@ -145,40 +142,43 @@ Class | Method | HTTP request | Description - [EndpointHttpServerTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointHttpServerTest.md) - [EndpointNetworkTopologyResultRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointNetworkTopologyResultRequest.md) - [EndpointNetworkTopologyResultRequestFilter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointNetworkTopologyResultRequestFilter.md) + - [EndpointPathTrace](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointPathTrace.md) + - [EndpointPathVisHop](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointPathVisHop.md) + - [EndpointPathVisRoute](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointPathVisRoute.md) - [EndpointPingDataPointScore](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointPingDataPointScore.md) - - [EndpointRealUserTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointRealUserTest.md) - - [EndpointRealUserTestBase](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointRealUserTestBase.md) - - [EndpointRealUserTestDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointRealUserTestDetail.md) - - [EndpointRealUserTestDetailResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointRealUserTestDetailResults.md) - - [EndpointRealUserTestResultRequestFilter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointRealUserTestResultRequestFilter.md) - - [EndpointRealUserTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointRealUserTestResults.md) - - [EndpointRealUserTestResultsRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointRealUserTestResultsRequest.md) - [EndpointResultRequestFilter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointResultRequestFilter.md) - [EndpointScheduledTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointScheduledTest.md) - [EndpointScheduledTestType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointScheduledTestType.md) - [EndpointSpecificAgentsSelectorConfig](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointSpecificAgentsSelectorConfig.md) - [EndpointTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointTest.md) - [EndpointTestAuthType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestAuthType.md) + - [EndpointTestEthernetProfile](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestEthernetProfile.md) - [EndpointTestLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestLinks.md) - [EndpointTestProtocol](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestProtocol.md) + - [EndpointTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestResult.md) - [EndpointTestResultProtocol](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestResultProtocol.md) - [EndpointTestSelfLink](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestSelfLink.md) + - [EndpointTestsDataRoundsSearch](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataRoundsSearch.md) + - [EndpointTestsDataSearchFilter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataSearchFilter.md) + - [EndpointTestsDataSearchSort](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataSearchSort.md) + - [EndpointTestsDataSearchSortKey](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataSearchSortKey.md) + - [EndpointTestsDataThresholdFilter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataThresholdFilter.md) + - [EndpointTestsDataThresholdFilters](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataThresholdFilters.md) - [Error](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/Error.md) - - [EthernetProfile](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/EthernetProfile.md) - - [Expand](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/Expand.md) + - [ExpandEndpointHttpServerOptions](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/ExpandEndpointHttpServerOptions.md) - [GatewayNetworkPing](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/GatewayNetworkPing.md) - [Hop](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/Hop.md) + - [HttpEndpointTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestResult.md) + - [HttpEndpointTestResultHeaders](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestResultHeaders.md) + - [HttpEndpointTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestResults.md) + - [HttpEndpointTestsDataRoundsSearch](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataRoundsSearch.md) + - [HttpEndpointTestsDataSearchFilter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataSearchFilter.md) + - [HttpEndpointTestsDataSearchSort](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataSearchSort.md) + - [HttpEndpointTestsDataSearchSortKey](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataSearchSortKey.md) + - [HttpEndpointTestsDataThresholdFilter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataThresholdFilter.md) + - [HttpEndpointTestsDataThresholdFilters](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataThresholdFilters.md) - [HttpErrorType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpErrorType.md) - - [HttpMultiTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpMultiTestResults.md) - - [HttpTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpTestResult.md) - - [HttpTestResultHeaders](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpTestResultHeaders.md) - - [HttpTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpTestResults.md) - - [HttpTestsDataRoundsSearch](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpTestsDataRoundsSearch.md) - - [HttpTestsDataSearchFilter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpTestsDataSearchFilter.md) - - [HttpTestsDataSearchSort](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpTestsDataSearchSort.md) - - [HttpTestsDataSearchSortKey](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpTestsDataSearchSortKey.md) - - [HttpTestsDataThresholdFilter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpTestsDataThresholdFilter.md) - - [HttpTestsDataThresholdFilters](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpTestsDataThresholdFilters.md) + - [HttpMultiEndpointTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpMultiEndpointTestResults.md) - [HttpThresholdFilterName](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/HttpThresholdFilterName.md) - [InterfaceHardwareType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/InterfaceHardwareType.md) - [Link](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/Link.md) @@ -188,49 +188,51 @@ Class | Method | HTTP request | Description - [LocalNetworkTopologyResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/LocalNetworkTopologyResult.md) - [LocalNetworkTopologyResultBase](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/LocalNetworkTopologyResultBase.md) - [LocalNetworkTopologyResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/LocalNetworkTopologyResults.md) - - [MultiTestIdNetworkTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdNetworkTestResults.md) - - [MultiTestIdTestsDataRoundsSearch](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdTestsDataRoundsSearch.md) - - [MultiTestIdTestsDataSearchFilter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdTestsDataSearchFilter.md) - - [NetworkDynamicTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicTestResult.md) - - [NetworkDynamicTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicTestResults.md) + - [MultiTestIdEndpointTestsDataRoundsSearch](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdEndpointTestsDataRoundsSearch.md) + - [MultiTestIdEndpointTestsDataSearchFilter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdEndpointTestsDataSearchFilter.md) + - [MultiTestIdNetworkEndpointTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdNetworkEndpointTestResults.md) + - [NetworkDynamicEndpointTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicEndpointTestResult.md) + - [NetworkDynamicEndpointTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicEndpointTestResults.md) + - [NetworkEndpointTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointTestResult.md) + - [NetworkEndpointTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointTestResults.md) - [NetworkInterface](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkInterface.md) - [NetworkMetrics](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkMetrics.md) - [NetworkPing](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkPing.md) - [NetworkProfile](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkProfile.md) - [NetworkProxy](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkProxy.md) - [NetworkProxyProfile](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkProxyProfile.md) - - [NetworkTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkTestResult.md) - - [NetworkTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkTestResults.md) - [NetworkTopologyType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkTopologyType.md) - [NetworkWirelessProfile](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/NetworkWirelessProfile.md) - [PaginationNextAndSelfLink](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PaginationNextAndSelfLink.md) - [PaginationNextLink](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PaginationNextLink.md) - - [PathVisBaseTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisBaseTestResult.md) - - [PathVisDetailDynamicTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailDynamicTestResult.md) - - [PathVisDetailDynamicTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailDynamicTestResults.md) - - [PathVisDetailTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailTestResult.md) - - [PathVisDetailTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailTestResults.md) - - [PathVisDynamicTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisDynamicTestResult.md) - - [PathVisDynamicTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisDynamicTestResults.md) - - [PathVisEndpoint](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisEndpoint.md) - - [PathVisHop](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisHop.md) - - [PathVisRoute](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisRoute.md) - - [PathVisTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisTestResult.md) - - [PathVisTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisTestResults.md) + - [PathVisBaseEndpointTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisBaseEndpointTestResult.md) + - [PathVisDetailDynamicEndpointTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailDynamicEndpointTestResult.md) + - [PathVisDetailDynamicEndpointTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailDynamicEndpointTestResults.md) + - [PathVisDetailEndpointTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailEndpointTestResult.md) + - [PathVisDetailEndpointTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailEndpointTestResults.md) + - [PathVisDynamicEndpointTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisDynamicEndpointTestResult.md) + - [PathVisDynamicEndpointTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisDynamicEndpointTestResults.md) + - [PathVisEndpointTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisEndpointTestResult.md) + - [PathVisEndpointTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PathVisEndpointTestResults.md) - [PhysicalMemoryUsedBytes](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/PhysicalMemoryUsedBytes.md) - [Platform](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/Platform.md) - - [RealUserTestCoordinates](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserTestCoordinates.md) - - [RealUserTestNetwork](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserTestNetwork.md) - - [RealUserTestNetworkResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserTestNetworkResult.md) - - [RealUserTestNetworkResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserTestNetworkResults.md) - - [RealUserTestPage](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserTestPage.md) - - [RealUserTestPageDetailResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserTestPageDetailResult.md) - - [RealUserTestPageResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserTestPageResult.md) - - [RealUserTestPageResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserTestPageResults.md) - - [RealUserTestPageTimings](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserTestPageTimings.md) + - [RealUserEndpointTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTest.md) + - [RealUserEndpointTestBase](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestBase.md) + - [RealUserEndpointTestCoordinates](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestCoordinates.md) + - [RealUserEndpointTestDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestDetail.md) + - [RealUserEndpointTestDetailResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestDetailResults.md) + - [RealUserEndpointTestNetwork](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestNetwork.md) + - [RealUserEndpointTestNetworkResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestNetworkResult.md) + - [RealUserEndpointTestNetworkResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestNetworkResults.md) + - [RealUserEndpointTestPage](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPage.md) + - [RealUserEndpointTestPageDetailResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageDetailResult.md) + - [RealUserEndpointTestPageResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageResult.md) + - [RealUserEndpointTestPageResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageResults.md) + - [RealUserEndpointTestPageTimings](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageTimings.md) + - [RealUserEndpointTestResultRequestFilter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultRequestFilter.md) + - [RealUserEndpointTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResults.md) + - [RealUserEndpointTestResultsRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultsRequest.md) - [SelfLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/SelfLinks.md) - - [SensitivityLevel](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/SensitivityLevel.md) - - [Severity](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/Severity.md) - [SortOrder](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/SortOrder.md) - [SystemMetrics](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/SystemMetrics.md) - [TargetNetworkPing](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/TargetNetworkPing.md) @@ -242,14 +244,7 @@ Class | Method | HTTP request | Description - [TestLabel](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/TestLabel.md) - [TestProbeModeResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/TestProbeModeResponse.md) - [TestProtocol](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/TestProtocol.md) - - [TestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/TestResult.md) - [TestSslVersionId](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/TestSslVersionId.md) - - [TestsDataRoundsSearch](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/TestsDataRoundsSearch.md) - - [TestsDataSearchFilter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/TestsDataSearchFilter.md) - - [TestsDataSearchSort](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/TestsDataSearchSort.md) - - [TestsDataSearchSortKey](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/TestsDataSearchSortKey.md) - - [TestsDataThresholdFilter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/TestsDataThresholdFilter.md) - - [TestsDataThresholdFilters](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/TestsDataThresholdFilters.md) - [ThresholdFilterName](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/ThresholdFilterName.md) - [ThresholdFilterOperator](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/ThresholdFilterOperator.md) - [Traceroute](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-test-results/docs/Traceroute.md) diff --git a/thousandeyes-sdk-endpoint-test-results/docs/DynamicBaseEndpointTestResult.md b/thousandeyes-sdk-endpoint-test-results/docs/DynamicBaseEndpointTestResult.md new file mode 100644 index 000000000..97262172c --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/DynamicBaseEndpointTestResult.md @@ -0,0 +1,33 @@ +# DynamicBaseEndpointTestResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**application** | **str** | Which supported application to monitor, can be one of `webex`, `zoom`, `microsoft-teams`. | [optional] +**protocol** | [**EndpointTestResultProtocol**](EndpointTestResultProtocol.md) | | [optional] +**tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] +**udp_probe_mode** | [**UdpProbeModeResponse**](UdpProbeModeResponse.md) | | [optional] +**webex** | [**DynamicEndpointTestWebex**](DynamicEndpointTestWebex.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.dynamic_base_endpoint_test_result import DynamicBaseEndpointTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicBaseEndpointTestResult from a JSON string +dynamic_base_endpoint_test_result_instance = DynamicBaseEndpointTestResult.from_json(json) +# print the JSON string representation of the object +print(DynamicBaseEndpointTestResult.to_json()) + +# convert the object into a dict +dynamic_base_endpoint_test_result_dict = dynamic_base_endpoint_test_result_instance.to_dict() +# create an instance of DynamicBaseEndpointTestResult from a dict +dynamic_base_endpoint_test_result_from_dict = DynamicBaseEndpointTestResult.from_dict(dynamic_base_endpoint_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/DynamicEndpointTestWebex.md b/thousandeyes-sdk-endpoint-test-results/docs/DynamicEndpointTestWebex.md new file mode 100644 index 000000000..1db540c44 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/DynamicEndpointTestWebex.md @@ -0,0 +1,33 @@ +# DynamicEndpointTestWebex + +Contains object with webex information. Only returned for webex applications. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conference_id** | **str** | Webex conference ID. | [optional] [readonly] +**correlation_id** | **str** | Webex conference correlation ID. | [optional] [readonly] +**local_sip_session_id** | **str** | Webex calling local sip session ID. | [optional] [readonly] +**remote_sip_session_id** | **str** | Webex calling remote sip session ID. | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.dynamic_endpoint_test_webex import DynamicEndpointTestWebex + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicEndpointTestWebex from a JSON string +dynamic_endpoint_test_webex_instance = DynamicEndpointTestWebex.from_json(json) +# print the JSON string representation of the object +print(DynamicEndpointTestWebex.to_json()) + +# convert the object into a dict +dynamic_endpoint_test_webex_dict = dynamic_endpoint_test_webex_instance.to_dict() +# create an instance of DynamicEndpointTestWebex from a dict +dynamic_endpoint_test_webex_from_dict = DynamicEndpointTestWebex.from_dict(dynamic_endpoint_test_webex_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/DynamicEndpointTestsDataRoundSearch.md b/thousandeyes-sdk-endpoint-test-results/docs/DynamicEndpointTestsDataRoundSearch.md new file mode 100644 index 000000000..812b31d8f --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/DynamicEndpointTestsDataRoundSearch.md @@ -0,0 +1,31 @@ +# DynamicEndpointTestsDataRoundSearch + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**search_sort** | [**List[EndpointTestsDataSearchSort]**](EndpointTestsDataSearchSort.md) | | [optional] +**threshold_filter** | [**EndpointTestsDataThresholdFilters**](EndpointTestsDataThresholdFilters.md) | | [optional] +**search_filters** | [**DynamicEndpointTestsDataSearchFilter**](DynamicEndpointTestsDataSearchFilter.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.dynamic_endpoint_tests_data_round_search import DynamicEndpointTestsDataRoundSearch + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicEndpointTestsDataRoundSearch from a JSON string +dynamic_endpoint_tests_data_round_search_instance = DynamicEndpointTestsDataRoundSearch.from_json(json) +# print the JSON string representation of the object +print(DynamicEndpointTestsDataRoundSearch.to_json()) + +# convert the object into a dict +dynamic_endpoint_tests_data_round_search_dict = dynamic_endpoint_tests_data_round_search_instance.to_dict() +# create an instance of DynamicEndpointTestsDataRoundSearch from a dict +dynamic_endpoint_tests_data_round_search_from_dict = DynamicEndpointTestsDataRoundSearch.from_dict(dynamic_endpoint_tests_data_round_search_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/DynamicEndpointTestsDataSearchFilter.md b/thousandeyes-sdk-endpoint-test-results/docs/DynamicEndpointTestsDataSearchFilter.md new file mode 100644 index 000000000..150c9942e --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/DynamicEndpointTestsDataSearchFilter.md @@ -0,0 +1,30 @@ +# DynamicEndpointTestsDataSearchFilter + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **List[str]** | Filter using the `agent-id`. | [optional] +**webex_conference_id** | **List[str]** | Filter using the `conference-id` of the webex call. | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.dynamic_endpoint_tests_data_search_filter import DynamicEndpointTestsDataSearchFilter + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamicEndpointTestsDataSearchFilter from a JSON string +dynamic_endpoint_tests_data_search_filter_instance = DynamicEndpointTestsDataSearchFilter.from_json(json) +# print the JSON string representation of the object +print(DynamicEndpointTestsDataSearchFilter.to_json()) + +# convert the object into a dict +dynamic_endpoint_tests_data_search_filter_dict = dynamic_endpoint_tests_data_search_filter_instance.to_dict() +# create an instance of DynamicEndpointTestsDataSearchFilter from a dict +dynamic_endpoint_tests_data_search_filter_from_dict = DynamicEndpointTestsDataSearchFilter.from_dict(dynamic_endpoint_tests_data_search_filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointAgentLabelsSelectorConfig.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointAgentLabelsSelectorConfig.md index e2be77477..5a771cd42 100644 --- a/thousandeyes-sdk-endpoint-test-results/docs/EndpointAgentLabelsSelectorConfig.md +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointAgentLabelsSelectorConfig.md @@ -7,7 +7,7 @@ Agent labels selection object. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **agent_selector_type** | **str** | | -**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] **endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] ## Example diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointAgentSelectorConfig.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointAgentSelectorConfig.md index ca93df4de..c3ec2874a 100644 --- a/thousandeyes-sdk-endpoint-test-results/docs/EndpointAgentSelectorConfig.md +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointAgentSelectorConfig.md @@ -7,7 +7,7 @@ Agents selection object based on agentSelectorType. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **agent_selector_type** | **str** | | -**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] **endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] **agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointAgentToServerTest.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointAgentToServerTest.md index b6797e6e3..aa743dd2c 100644 --- a/thousandeyes-sdk-endpoint-test-results/docs/EndpointAgentToServerTest.md +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointAgentToServerTest.md @@ -15,14 +15,13 @@ Name | Type | Description | Notes **has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] **modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] **protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] **server** | **str** | Target domain name or IP address. | [optional] **test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] **test_name** | **str** | Name of the test. | [optional] **type** | **str** | Type of test being queried. | [readonly] **tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] -**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**port** | **int** | Port number. | [optional] [default to 443] **labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointAllAgentsSelectorConfig.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointAllAgentsSelectorConfig.md index 3c5b964da..e5f4d55e4 100644 --- a/thousandeyes-sdk-endpoint-test-results/docs/EndpointAllAgentsSelectorConfig.md +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointAllAgentsSelectorConfig.md @@ -7,7 +7,7 @@ Any agent selection object. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **agent_selector_type** | **str** | | -**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] ## Example diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointHttpServerBaseTest.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointHttpServerBaseTest.md index c29b570bb..b0263c0e0 100644 --- a/thousandeyes-sdk-endpoint-test-results/docs/EndpointHttpServerBaseTest.md +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointHttpServerBaseTest.md @@ -7,13 +7,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] **has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] -**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] [default to 5000] **protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] -**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | [optional] **username** | **str** | Username for Basic/NTLM authentication. | [optional] **ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] **tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] -**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] [default to True] +**url** | **str** | The test target URL. | [optional] ## Example diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointHttpServerTest.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointHttpServerTest.md index ab04d912b..d43445480 100644 --- a/thousandeyes-sdk-endpoint-test-results/docs/EndpointHttpServerTest.md +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointHttpServerTest.md @@ -15,28 +15,24 @@ Name | Type | Description | Notes **has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] **modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] **protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] **server** | **str** | Target domain name or IP address. | [optional] **test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] **test_name** | **str** | Name of the test. | [optional] **type** | **str** | Type of test being queried. | [readonly] **tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] -**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**port** | **int** | Port number. | [optional] [default to 443] **auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] -**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] -**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] [default to 5000] **username** | **str** | Username for Basic/NTLM authentication. | [optional] **ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] -**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] -**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] [default to True] +**url** | **str** | The test target URL. | [optional] **follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] **http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] -**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] **ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] **use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] -**user_agent** | **str** | User-agent string to be provided during the test. | [optional] **labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointPathTrace.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointPathTrace.md new file mode 100644 index 000000000..bd647bdf9 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointPathTrace.md @@ -0,0 +1,35 @@ +# EndpointPathTrace + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ip_address** | **str** | IP address of the hop destination. | [optional] [readonly] +**number_of_hops** | **int** | Number of hops for path trace to destination. | [optional] [readonly] +**protocol** | [**EndpointTestResultProtocol**](EndpointTestResultProtocol.md) | | [optional] +**tcp_path_trace_mode** | [**TcpPathTraceModeResponse**](TcpPathTraceModeResponse.md) | | [optional] +**udp_path_trace_mode** | [**UdpPathTraceModeResponse**](UdpPathTraceModeResponse.md) | | [optional] +**path_id** | **str** | Unique ID of path trace. | [optional] [readonly] +**response_time** | **int** | RTT of the path trace to the destination in milliseconds. | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.endpoint_path_trace import EndpointPathTrace + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointPathTrace from a JSON string +endpoint_path_trace_instance = EndpointPathTrace.from_json(json) +# print the JSON string representation of the object +print(EndpointPathTrace.to_json()) + +# convert the object into a dict +endpoint_path_trace_dict = endpoint_path_trace_instance.to_dict() +# create an instance of EndpointPathTrace from a dict +endpoint_path_trace_from_dict = EndpointPathTrace.from_dict(endpoint_path_trace_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointPathVisHop.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointPathVisHop.md new file mode 100644 index 000000000..497e4fb6e --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointPathVisHop.md @@ -0,0 +1,35 @@ +# EndpointPathVisHop + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hop** | **int** | The hop index. | [optional] [readonly] +**ip_address** | **str** | IP address of the hop. | [optional] [readonly] +**prefix** | **str** | Prefix of IP address shown in CIDR. | [optional] [readonly] +**rdns** | **str** | Reverse DNS entry of IP, if available. | [optional] [readonly] +**network** | **str** | Autonomous System originating the prefix. | [optional] [readonly] +**response_time** | **int** | RTT to the hop’s IP in milliseconds. | [optional] [readonly] +**location** | **str** | Location information for the hop. | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.endpoint_path_vis_hop import EndpointPathVisHop + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointPathVisHop from a JSON string +endpoint_path_vis_hop_instance = EndpointPathVisHop.from_json(json) +# print the JSON string representation of the object +print(EndpointPathVisHop.to_json()) + +# convert the object into a dict +endpoint_path_vis_hop_dict = endpoint_path_vis_hop_instance.to_dict() +# create an instance of EndpointPathVisHop from a dict +endpoint_path_vis_hop_from_dict = EndpointPathVisHop.from_dict(endpoint_path_vis_hop_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointPathVisRoute.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointPathVisRoute.md new file mode 100644 index 000000000..b787dbea5 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointPathVisRoute.md @@ -0,0 +1,33 @@ +# EndpointPathVisRoute + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**path_id** | **str** | Unique ID of path trace. | [optional] [readonly] +**protocol** | [**EndpointTestResultProtocol**](EndpointTestResultProtocol.md) | | [optional] +**tcp_path_trace_mode** | [**TcpPathTraceModeResponse**](TcpPathTraceModeResponse.md) | | [optional] +**udp_path_trace_mode** | [**UdpPathTraceModeResponse**](UdpPathTraceModeResponse.md) | | [optional] +**hops** | [**List[EndpointPathVisHop]**](EndpointPathVisHop.md) | Array of hop objects indicating each step in the traceroute. | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.endpoint_path_vis_route import EndpointPathVisRoute + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointPathVisRoute from a JSON string +endpoint_path_vis_route_instance = EndpointPathVisRoute.from_json(json) +# print the JSON string representation of the object +print(EndpointPathVisRoute.to_json()) + +# convert the object into a dict +endpoint_path_vis_route_dict = endpoint_path_vis_route_instance.to_dict() +# create an instance of EndpointPathVisRoute from a dict +endpoint_path_vis_route_from_dict = EndpointPathVisRoute.from_dict(endpoint_path_vis_route_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointScheduledTest.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointScheduledTest.md index 06573c4eb..fc5816bbe 100644 --- a/thousandeyes-sdk-endpoint-test-results/docs/EndpointScheduledTest.md +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointScheduledTest.md @@ -15,29 +15,25 @@ Name | Type | Description | Notes **has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] **modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] **protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] **server** | **str** | Target domain name or IP address. | [optional] **test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] **test_name** | **str** | Name of the test. | [optional] **type** | **str** | Type of test being queried. | [readonly] **tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] -**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**port** | **int** | Port number. | [optional] [default to 443] **labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] **auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] -**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] -**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] [default to 5000] **username** | **str** | Username for Basic/NTLM authentication. | [optional] **ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] -**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] -**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] [default to True] +**url** | **str** | The test target URL. | [optional] **follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] **http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] -**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] **ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] **use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] -**user_agent** | **str** | User-agent string to be provided during the test. | [optional] ## Example diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointSpecificAgentsSelectorConfig.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointSpecificAgentsSelectorConfig.md index f0729aebd..6658e632f 100644 --- a/thousandeyes-sdk-endpoint-test-results/docs/EndpointSpecificAgentsSelectorConfig.md +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointSpecificAgentsSelectorConfig.md @@ -7,7 +7,7 @@ Specific agents selection object. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **agent_selector_type** | **str** | | -**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] **agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] ## Example diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointTest.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTest.md index 36cefed12..f75b34752 100644 --- a/thousandeyes-sdk-endpoint-test-results/docs/EndpointTest.md +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTest.md @@ -15,14 +15,13 @@ Name | Type | Description | Notes **has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] **modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] **protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] **server** | **str** | Target domain name or IP address. | [optional] **test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] **test_name** | **str** | Name of the test. | [optional] **type** | [**EndpointScheduledTestType**](EndpointScheduledTestType.md) | | **tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] -**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**port** | **int** | Port number. | [optional] [default to 443] ## Example diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestEthernetProfile.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestEthernetProfile.md new file mode 100644 index 000000000..9c63045c7 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestEthernetProfile.md @@ -0,0 +1,29 @@ +# EndpointTestEthernetProfile + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**link_speed** | **int** | Ethernet profile link speed | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_ethernet_profile import EndpointTestEthernetProfile + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestEthernetProfile from a JSON string +endpoint_test_ethernet_profile_instance = EndpointTestEthernetProfile.from_json(json) +# print the JSON string representation of the object +print(EndpointTestEthernetProfile.to_json()) + +# convert the object into a dict +endpoint_test_ethernet_profile_dict = endpoint_test_ethernet_profile_instance.to_dict() +# create an instance of EndpointTestEthernetProfile from a dict +endpoint_test_ethernet_profile_from_dict = EndpointTestEthernetProfile.from_dict(endpoint_test_ethernet_profile_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestResult.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestResult.md new file mode 100644 index 000000000..f82b98fc2 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestResult.md @@ -0,0 +1,37 @@ +# EndpointTestResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**test_id** | **str** | Unique ID of endpoint test. | [optional] [readonly] +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of target server. | [optional] [readonly] +**network_profile** | [**NetworkProfile**](NetworkProfile.md) | | [optional] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**original_target_profile** | [**TargetProfile**](TargetProfile.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_result import EndpointTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestResult from a JSON string +endpoint_test_result_instance = EndpointTestResult.from_json(json) +# print the JSON string representation of the object +print(EndpointTestResult.to_json()) + +# convert the object into a dict +endpoint_test_result_dict = endpoint_test_result_instance.to_dict() +# create an instance of EndpointTestResult from a dict +endpoint_test_result_from_dict = EndpointTestResult.from_dict(endpoint_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataRoundsSearch.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataRoundsSearch.md new file mode 100644 index 000000000..bf3580f85 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataRoundsSearch.md @@ -0,0 +1,31 @@ +# EndpointTestsDataRoundsSearch + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**search_sort** | [**List[EndpointTestsDataSearchSort]**](EndpointTestsDataSearchSort.md) | | [optional] +**threshold_filter** | [**EndpointTestsDataThresholdFilters**](EndpointTestsDataThresholdFilters.md) | | [optional] +**search_filters** | [**EndpointTestsDataSearchFilter**](EndpointTestsDataSearchFilter.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_rounds_search import EndpointTestsDataRoundsSearch + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestsDataRoundsSearch from a JSON string +endpoint_tests_data_rounds_search_instance = EndpointTestsDataRoundsSearch.from_json(json) +# print the JSON string representation of the object +print(EndpointTestsDataRoundsSearch.to_json()) + +# convert the object into a dict +endpoint_tests_data_rounds_search_dict = endpoint_tests_data_rounds_search_instance.to_dict() +# create an instance of EndpointTestsDataRoundsSearch from a dict +endpoint_tests_data_rounds_search_from_dict = EndpointTestsDataRoundsSearch.from_dict(endpoint_tests_data_rounds_search_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataSearchFilter.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataSearchFilter.md new file mode 100644 index 000000000..cc05b633d --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataSearchFilter.md @@ -0,0 +1,29 @@ +# EndpointTestsDataSearchFilter + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **List[str]** | Filter using the `agent-id`. | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_search_filter import EndpointTestsDataSearchFilter + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestsDataSearchFilter from a JSON string +endpoint_tests_data_search_filter_instance = EndpointTestsDataSearchFilter.from_json(json) +# print the JSON string representation of the object +print(EndpointTestsDataSearchFilter.to_json()) + +# convert the object into a dict +endpoint_tests_data_search_filter_dict = endpoint_tests_data_search_filter_instance.to_dict() +# create an instance of EndpointTestsDataSearchFilter from a dict +endpoint_tests_data_search_filter_from_dict = EndpointTestsDataSearchFilter.from_dict(endpoint_tests_data_search_filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataSearchSort.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataSearchSort.md new file mode 100644 index 000000000..e181e00c9 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataSearchSort.md @@ -0,0 +1,30 @@ +# EndpointTestsDataSearchSort + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sort** | [**EndpointTestsDataSearchSortKey**](EndpointTestsDataSearchSortKey.md) | | [optional] +**order** | [**SortOrder**](SortOrder.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_search_sort import EndpointTestsDataSearchSort + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestsDataSearchSort from a JSON string +endpoint_tests_data_search_sort_instance = EndpointTestsDataSearchSort.from_json(json) +# print the JSON string representation of the object +print(EndpointTestsDataSearchSort.to_json()) + +# convert the object into a dict +endpoint_tests_data_search_sort_dict = endpoint_tests_data_search_sort_instance.to_dict() +# create an instance of EndpointTestsDataSearchSort from a dict +endpoint_tests_data_search_sort_from_dict = EndpointTestsDataSearchSort.from_dict(endpoint_tests_data_search_sort_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataSearchSortKey.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataSearchSortKey.md new file mode 100644 index 000000000..e824ef8e6 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataSearchSortKey.md @@ -0,0 +1,11 @@ +# EndpointTestsDataSearchSortKey + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataThresholdFilter.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataThresholdFilter.md new file mode 100644 index 000000000..2347098bc --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataThresholdFilter.md @@ -0,0 +1,32 @@ +# EndpointTestsDataThresholdFilter + +The metric is filtered based on the threshold value and operator provided. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | [**ThresholdFilterName**](ThresholdFilterName.md) | | [optional] +**value** | **float** | The threshold value. | [optional] +**operator** | [**ThresholdFilterOperator**](ThresholdFilterOperator.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_threshold_filter import EndpointTestsDataThresholdFilter + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestsDataThresholdFilter from a JSON string +endpoint_tests_data_threshold_filter_instance = EndpointTestsDataThresholdFilter.from_json(json) +# print the JSON string representation of the object +print(EndpointTestsDataThresholdFilter.to_json()) + +# convert the object into a dict +endpoint_tests_data_threshold_filter_dict = endpoint_tests_data_threshold_filter_instance.to_dict() +# create an instance of EndpointTestsDataThresholdFilter from a dict +endpoint_tests_data_threshold_filter_from_dict = EndpointTestsDataThresholdFilter.from_dict(endpoint_tests_data_threshold_filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataThresholdFilters.md b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataThresholdFilters.md new file mode 100644 index 000000000..4a0b59a22 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/EndpointTestsDataThresholdFilters.md @@ -0,0 +1,31 @@ +# EndpointTestsDataThresholdFilters + +All filters are applied based on the conditional operator (and/or). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filters** | [**List[EndpointTestsDataThresholdFilter]**](EndpointTestsDataThresholdFilter.md) | | [optional] +**conditional_operator** | [**ConditionalOperator**](ConditionalOperator.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_threshold_filters import EndpointTestsDataThresholdFilters + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointTestsDataThresholdFilters from a JSON string +endpoint_tests_data_threshold_filters_instance = EndpointTestsDataThresholdFilters.from_json(json) +# print the JSON string representation of the object +print(EndpointTestsDataThresholdFilters.to_json()) + +# convert the object into a dict +endpoint_tests_data_threshold_filters_dict = endpoint_tests_data_threshold_filters_instance.to_dict() +# create an instance of EndpointTestsDataThresholdFilters from a dict +endpoint_tests_data_threshold_filters_from_dict = EndpointTestsDataThresholdFilters.from_dict(endpoint_tests_data_threshold_filters_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/ExpandEndpointHttpServerOptions.md b/thousandeyes-sdk-endpoint-test-results/docs/ExpandEndpointHttpServerOptions.md new file mode 100644 index 000000000..b7735dc9b --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/ExpandEndpointHttpServerOptions.md @@ -0,0 +1,11 @@ +# ExpandEndpointHttpServerOptions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/HTTPServerEndpointScheduledTestResultsApi.md b/thousandeyes-sdk-endpoint-test-results/docs/HTTPServerEndpointScheduledTestResultsApi.md new file mode 100644 index 000000000..da1498629 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/HTTPServerEndpointScheduledTestResultsApi.md @@ -0,0 +1,206 @@ +# thousandeyes_sdk.endpoint_test_results.HTTPServerEndpointScheduledTestResultsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_http_server_scheduled_test_results**](HTTPServerEndpointScheduledTestResultsApi.md#get_http_server_scheduled_test_results) | **GET** /endpoint/test-results/scheduled-tests/{testId}/http-server | Retrieve HTTP server scheduled test results +[**get_multi_test_filtered_http_server_scheduled_test_results**](HTTPServerEndpointScheduledTestResultsApi.md#get_multi_test_filtered_http_server_scheduled_test_results) | **POST** /endpoint/test-results/scheduled-tests/http-server/filter | Filter HTTP server scheduled test results + + +# **get_http_server_scheduled_test_results** +> HttpEndpointTestResults get_http_server_scheduled_test_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, expand=expand) + +Retrieve HTTP server scheduled test results + +Returns component-level (DNS, Connect, Wait and Receive) timing for the load of an object over HTTP. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_test_results +from thousandeyes_sdk.endpoint_test_results.models.expand_endpoint_http_server_options import ExpandEndpointHttpServerOptions +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_test_results import HttpEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_test_results.HTTPServerEndpointScheduledTestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + expand = [thousandeyes_sdk.endpoint_test_results.ExpandEndpointHttpServerOptions()] # List[ExpandEndpointHttpServerOptions] | This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query. (optional) + + try: + # Retrieve HTTP server scheduled test results + api_response = api_instance.get_http_server_scheduled_test_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, expand=expand) + print("The response of HTTPServerEndpointScheduledTestResultsApi->get_http_server_scheduled_test_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPServerEndpointScheduledTestResultsApi->get_http_server_scheduled_test_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + **expand** | [**List[ExpandEndpointHttpServerOptions]**](ExpandEndpointHttpServerOptions.md)| This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query. | [optional] + +### Return type + +[**HttpEndpointTestResults**](HttpEndpointTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_multi_test_filtered_http_server_scheduled_test_results** +> HttpMultiEndpointTestResults get_multi_test_filtered_http_server_scheduled_test_results(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, expand=expand, http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search) + +Filter HTTP server scheduled test results + +Returns component-level (DNS, Connect, Wait and Receive) timing for the load of an object over HTTP. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_test_results +from thousandeyes_sdk.endpoint_test_results.models.expand_endpoint_http_server_options import ExpandEndpointHttpServerOptions +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_rounds_search import HttpEndpointTestsDataRoundsSearch +from thousandeyes_sdk.endpoint_test_results.models.http_multi_endpoint_test_results import HttpMultiEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_test_results.HTTPServerEndpointScheduledTestResultsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + expand = [thousandeyes_sdk.endpoint_test_results.ExpandEndpointHttpServerOptions()] # List[ExpandEndpointHttpServerOptions] | This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query. (optional) + http_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.HttpEndpointTestsDataRoundsSearch() # HttpEndpointTestsDataRoundsSearch | Test data search filters. (optional) + + try: + # Filter HTTP server scheduled test results + api_response = api_instance.get_multi_test_filtered_http_server_scheduled_test_results(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, expand=expand, http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search) + print("The response of HTTPServerEndpointScheduledTestResultsApi->get_multi_test_filtered_http_server_scheduled_test_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPServerEndpointScheduledTestResultsApi->get_multi_test_filtered_http_server_scheduled_test_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + **expand** | [**List[ExpandEndpointHttpServerOptions]**](ExpandEndpointHttpServerOptions.md)| This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query. | [optional] + **http_endpoint_tests_data_rounds_search** | [**HttpEndpointTestsDataRoundsSearch**](HttpEndpointTestsDataRoundsSearch.md)| Test data search filters. | [optional] + +### Return type + +[**HttpMultiEndpointTestResults**](HttpMultiEndpointTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestResult.md b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestResult.md new file mode 100644 index 000000000..d9d741342 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestResult.md @@ -0,0 +1,51 @@ +# HttpEndpointTestResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**test_id** | **str** | Unique ID of endpoint test. | [optional] [readonly] +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of destination server. | [optional] [readonly] +**network_profile** | [**NetworkProfile**](NetworkProfile.md) | | [optional] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**original_target_profile** | [**TargetProfile**](TargetProfile.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] +**connect_time** | **int** | Time required to establish a TCP connection to the server in milliseconds. | [optional] [readonly] +**dns_time** | **int** | Time required to resolve DNS in milliseconds. | [optional] [readonly] +**error_type** | [**HttpErrorType**](HttpErrorType.md) | | [optional] +**error_details** | **str** | Error details, if an error were encountered. | [optional] [readonly] +**headers** | [**HttpEndpointTestResultHeaders**](HttpEndpointTestResultHeaders.md) | | [optional] +**num_redirects** | **int** | Number of redirects. | [optional] [readonly] +**receive_time** | **int** | Elapsed time between first and last byte of response in milliseconds. | [optional] [readonly] +**redirect_time** | **int** | Cumulative redirect timing in milliseconds. | [optional] [readonly] +**response_code** | **int** | HTTP response code. | [optional] [readonly] +**response_time** | **int** | Time to first byte in milliseconds. | [optional] [readonly] +**ssl_time** | **int** | Time to negotiate SSL/TLS in milliseconds. | [optional] [readonly] +**total_time** | **int** | Total time is the response time + receive time. | [optional] [readonly] +**wait_time** | **int** | Time elapsed between completion of request and first byte of response in milliseconds. | [optional] [readonly] +**wire_size** | **int** | Size of content in bytes. | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_test_result import HttpEndpointTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpEndpointTestResult from a JSON string +http_endpoint_test_result_instance = HttpEndpointTestResult.from_json(json) +# print the JSON string representation of the object +print(HttpEndpointTestResult.to_json()) + +# convert the object into a dict +http_endpoint_test_result_dict = http_endpoint_test_result_instance.to_dict() +# create an instance of HttpEndpointTestResult from a dict +http_endpoint_test_result_from_dict = HttpEndpointTestResult.from_dict(http_endpoint_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestResultHeaders.md b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestResultHeaders.md new file mode 100644 index 000000000..65199637c --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestResultHeaders.md @@ -0,0 +1,31 @@ +# HttpEndpointTestResultHeaders + +Expandable object containing both request and response headers. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_headers** | **str** | CRLF-delimited list of request headers in `header: value` format. | [optional] [readonly] +**response_headers** | **str** | CRLF-delimited list of response headers in `header: value` format. | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_test_result_headers import HttpEndpointTestResultHeaders + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpEndpointTestResultHeaders from a JSON string +http_endpoint_test_result_headers_instance = HttpEndpointTestResultHeaders.from_json(json) +# print the JSON string representation of the object +print(HttpEndpointTestResultHeaders.to_json()) + +# convert the object into a dict +http_endpoint_test_result_headers_dict = http_endpoint_test_result_headers_instance.to_dict() +# create an instance of HttpEndpointTestResultHeaders from a dict +http_endpoint_test_result_headers_from_dict = HttpEndpointTestResultHeaders.from_dict(http_endpoint_test_result_headers_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestResults.md b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestResults.md new file mode 100644 index 000000000..20075a99b --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestResults.md @@ -0,0 +1,33 @@ +# HttpEndpointTestResults + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[HttpEndpointTestResult]**](HttpEndpointTestResult.md) | | [optional] +**test** | [**EndpointHttpServerTest**](EndpointHttpServerTest.md) | | [optional] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**links** | [**PaginationNextAndSelfLink**](PaginationNextAndSelfLink.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_test_results import HttpEndpointTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpEndpointTestResults from a JSON string +http_endpoint_test_results_instance = HttpEndpointTestResults.from_json(json) +# print the JSON string representation of the object +print(HttpEndpointTestResults.to_json()) + +# convert the object into a dict +http_endpoint_test_results_dict = http_endpoint_test_results_instance.to_dict() +# create an instance of HttpEndpointTestResults from a dict +http_endpoint_test_results_from_dict = HttpEndpointTestResults.from_dict(http_endpoint_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataRoundsSearch.md b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataRoundsSearch.md new file mode 100644 index 000000000..0c82d3dc5 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataRoundsSearch.md @@ -0,0 +1,31 @@ +# HttpEndpointTestsDataRoundsSearch + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**search_sort** | [**List[HttpEndpointTestsDataSearchSort]**](HttpEndpointTestsDataSearchSort.md) | | [optional] +**threshold_filter** | [**HttpEndpointTestsDataThresholdFilters**](HttpEndpointTestsDataThresholdFilters.md) | | [optional] +**search_filters** | [**HttpEndpointTestsDataSearchFilter**](HttpEndpointTestsDataSearchFilter.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_rounds_search import HttpEndpointTestsDataRoundsSearch + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpEndpointTestsDataRoundsSearch from a JSON string +http_endpoint_tests_data_rounds_search_instance = HttpEndpointTestsDataRoundsSearch.from_json(json) +# print the JSON string representation of the object +print(HttpEndpointTestsDataRoundsSearch.to_json()) + +# convert the object into a dict +http_endpoint_tests_data_rounds_search_dict = http_endpoint_tests_data_rounds_search_instance.to_dict() +# create an instance of HttpEndpointTestsDataRoundsSearch from a dict +http_endpoint_tests_data_rounds_search_from_dict = HttpEndpointTestsDataRoundsSearch.from_dict(http_endpoint_tests_data_rounds_search_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataSearchFilter.md b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataSearchFilter.md new file mode 100644 index 000000000..832b04fe8 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataSearchFilter.md @@ -0,0 +1,30 @@ +# HttpEndpointTestsDataSearchFilter + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**test_id** | **List[str]** | Filter by test | [optional] +**agent_id** | **List[str]** | Filter using the `agent-id`. | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_search_filter import HttpEndpointTestsDataSearchFilter + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpEndpointTestsDataSearchFilter from a JSON string +http_endpoint_tests_data_search_filter_instance = HttpEndpointTestsDataSearchFilter.from_json(json) +# print the JSON string representation of the object +print(HttpEndpointTestsDataSearchFilter.to_json()) + +# convert the object into a dict +http_endpoint_tests_data_search_filter_dict = http_endpoint_tests_data_search_filter_instance.to_dict() +# create an instance of HttpEndpointTestsDataSearchFilter from a dict +http_endpoint_tests_data_search_filter_from_dict = HttpEndpointTestsDataSearchFilter.from_dict(http_endpoint_tests_data_search_filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataSearchSort.md b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataSearchSort.md new file mode 100644 index 000000000..2a6d17e25 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataSearchSort.md @@ -0,0 +1,30 @@ +# HttpEndpointTestsDataSearchSort + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sort** | [**HttpEndpointTestsDataSearchSortKey**](HttpEndpointTestsDataSearchSortKey.md) | | [optional] +**order** | [**SortOrder**](SortOrder.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_search_sort import HttpEndpointTestsDataSearchSort + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpEndpointTestsDataSearchSort from a JSON string +http_endpoint_tests_data_search_sort_instance = HttpEndpointTestsDataSearchSort.from_json(json) +# print the JSON string representation of the object +print(HttpEndpointTestsDataSearchSort.to_json()) + +# convert the object into a dict +http_endpoint_tests_data_search_sort_dict = http_endpoint_tests_data_search_sort_instance.to_dict() +# create an instance of HttpEndpointTestsDataSearchSort from a dict +http_endpoint_tests_data_search_sort_from_dict = HttpEndpointTestsDataSearchSort.from_dict(http_endpoint_tests_data_search_sort_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataSearchSortKey.md b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataSearchSortKey.md new file mode 100644 index 000000000..a9bd7419c --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataSearchSortKey.md @@ -0,0 +1,11 @@ +# HttpEndpointTestsDataSearchSortKey + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataThresholdFilter.md b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataThresholdFilter.md new file mode 100644 index 000000000..0d6c2215d --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataThresholdFilter.md @@ -0,0 +1,32 @@ +# HttpEndpointTestsDataThresholdFilter + +The metric is filtered based on the threshold value and operator provided. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | [**HttpThresholdFilterName**](HttpThresholdFilterName.md) | | [optional] +**value** | **float** | The threshold value. | [optional] +**operator** | [**ThresholdFilterOperator**](ThresholdFilterOperator.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_threshold_filter import HttpEndpointTestsDataThresholdFilter + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpEndpointTestsDataThresholdFilter from a JSON string +http_endpoint_tests_data_threshold_filter_instance = HttpEndpointTestsDataThresholdFilter.from_json(json) +# print the JSON string representation of the object +print(HttpEndpointTestsDataThresholdFilter.to_json()) + +# convert the object into a dict +http_endpoint_tests_data_threshold_filter_dict = http_endpoint_tests_data_threshold_filter_instance.to_dict() +# create an instance of HttpEndpointTestsDataThresholdFilter from a dict +http_endpoint_tests_data_threshold_filter_from_dict = HttpEndpointTestsDataThresholdFilter.from_dict(http_endpoint_tests_data_threshold_filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataThresholdFilters.md b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataThresholdFilters.md new file mode 100644 index 000000000..43c7354ca --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/HttpEndpointTestsDataThresholdFilters.md @@ -0,0 +1,31 @@ +# HttpEndpointTestsDataThresholdFilters + +All filters are applied based on the conditional operator (and/or). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filters** | [**List[HttpEndpointTestsDataThresholdFilter]**](HttpEndpointTestsDataThresholdFilter.md) | | [optional] +**conditional_operator** | [**ConditionalOperator**](ConditionalOperator.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_threshold_filters import HttpEndpointTestsDataThresholdFilters + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpEndpointTestsDataThresholdFilters from a JSON string +http_endpoint_tests_data_threshold_filters_instance = HttpEndpointTestsDataThresholdFilters.from_json(json) +# print the JSON string representation of the object +print(HttpEndpointTestsDataThresholdFilters.to_json()) + +# convert the object into a dict +http_endpoint_tests_data_threshold_filters_dict = http_endpoint_tests_data_threshold_filters_instance.to_dict() +# create an instance of HttpEndpointTestsDataThresholdFilters from a dict +http_endpoint_tests_data_threshold_filters_from_dict = HttpEndpointTestsDataThresholdFilters.from_dict(http_endpoint_tests_data_threshold_filters_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/HttpMultiEndpointTestResults.md b/thousandeyes-sdk-endpoint-test-results/docs/HttpMultiEndpointTestResults.md new file mode 100644 index 000000000..5a059d973 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/HttpMultiEndpointTestResults.md @@ -0,0 +1,33 @@ +# HttpMultiEndpointTestResults + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[HttpEndpointTestResult]**](HttpEndpointTestResult.md) | | [optional] +**total_hits** | **int** | Total number of measurements that match the search criteria | [optional] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**links** | [**PaginationNextAndSelfLink**](PaginationNextAndSelfLink.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.http_multi_endpoint_test_results import HttpMultiEndpointTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpMultiEndpointTestResults from a JSON string +http_multi_endpoint_test_results_instance = HttpMultiEndpointTestResults.from_json(json) +# print the JSON string representation of the object +print(HttpMultiEndpointTestResults.to_json()) + +# convert the object into a dict +http_multi_endpoint_test_results_dict = http_multi_endpoint_test_results_instance.to_dict() +# create an instance of HttpMultiEndpointTestResults from a dict +http_multi_endpoint_test_results_from_dict = HttpMultiEndpointTestResults.from_dict(http_multi_endpoint_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/LocalNetworkEndpointTestResultsApi.md b/thousandeyes-sdk-endpoint-test-results/docs/LocalNetworkEndpointTestResultsApi.md new file mode 100644 index 000000000..1fde912f3 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/LocalNetworkEndpointTestResultsApi.md @@ -0,0 +1,277 @@ +# thousandeyes_sdk.endpoint_test_results.LocalNetworkEndpointTestResultsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**filter_local_networks_test_results_topologies**](LocalNetworkEndpointTestResultsApi.md#filter_local_networks_test_results_topologies) | **POST** /endpoint/test-results/local-networks/topologies/filter | List endpoint network topologies probes +[**get_local_networks_test_results**](LocalNetworkEndpointTestResultsApi.md#get_local_networks_test_results) | **GET** /endpoint/test-results/local-networks | List local networks +[**get_local_networks_test_results_topology**](LocalNetworkEndpointTestResultsApi.md#get_local_networks_test_results_topology) | **GET** /endpoint/test-results/local-networks/topologies/{networkTopologyId} | Retrieve endpoint local network topology + + +# **filter_local_networks_test_results_topologies** +> LocalNetworkTopologyResults filter_local_networks_test_results_topologies(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, endpoint_network_topology_result_request=endpoint_network_topology_result_request) + +List endpoint network topologies probes + +Returns a list of all endpoint local network topologies probes. Results from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter?window=12h' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Warning Note that a maximum of 12h worth of data can be retrieved at once. If you need more, you need to make multiple requests. Returns a `results` array of network topology probes. Network topology probes shown are from the latest round, or based on the time range specified. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_test_results +from thousandeyes_sdk.endpoint_test_results.models.endpoint_network_topology_result_request import EndpointNetworkTopologyResultRequest +from thousandeyes_sdk.endpoint_test_results.models.local_network_topology_results import LocalNetworkTopologyResults +from thousandeyes_sdk.endpoint_test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_test_results.LocalNetworkEndpointTestResultsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + endpoint_network_topology_result_request = thousandeyes_sdk.endpoint_test_results.EndpointNetworkTopologyResultRequest() # EndpointNetworkTopologyResultRequest | (optional) + + try: + # List endpoint network topologies probes + api_response = api_instance.filter_local_networks_test_results_topologies(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, endpoint_network_topology_result_request=endpoint_network_topology_result_request) + print("The response of LocalNetworkEndpointTestResultsApi->filter_local_networks_test_results_topologies:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LocalNetworkEndpointTestResultsApi->filter_local_networks_test_results_topologies: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + **endpoint_network_topology_result_request** | [**EndpointNetworkTopologyResultRequest**](EndpointNetworkTopologyResultRequest.md)| | [optional] + +### Return type + +[**LocalNetworkTopologyResults**](LocalNetworkTopologyResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_local_networks_test_results** +> LocalNetworkResults get_local_networks_test_results(aid=aid) + +List local networks + +Returns a list of all the networks used by endpoint agents. Sends back a `localNetworks` array. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_test_results +from thousandeyes_sdk.endpoint_test_results.models.local_network_results import LocalNetworkResults +from thousandeyes_sdk.endpoint_test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_test_results.LocalNetworkEndpointTestResultsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List local networks + api_response = api_instance.get_local_networks_test_results(aid=aid) + print("The response of LocalNetworkEndpointTestResultsApi->get_local_networks_test_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LocalNetworkEndpointTestResultsApi->get_local_networks_test_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**LocalNetworkResults**](LocalNetworkResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_local_networks_test_results_topology** +> LocalNetworkTopologyDetailResults get_local_networks_test_results_topology(network_topology_id, aid=aid) + +Retrieve endpoint local network topology + +Returns detailed data of a local network topology. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_test_results +from thousandeyes_sdk.endpoint_test_results.models.local_network_topology_detail_results import LocalNetworkTopologyDetailResults +from thousandeyes_sdk.endpoint_test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_test_results.LocalNetworkEndpointTestResultsApi(api_client) + network_topology_id = '00160:39c518560de9:1491651900:236e6f18' # str | The network topology ID. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Retrieve endpoint local network topology + api_response = api_instance.get_local_networks_test_results_topology(network_topology_id, aid=aid) + print("The response of LocalNetworkEndpointTestResultsApi->get_local_networks_test_results_topology:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LocalNetworkEndpointTestResultsApi->get_local_networks_test_results_topology: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **network_topology_id** | **str**| The network topology ID. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**LocalNetworkTopologyDetailResults**](LocalNetworkTopologyDetailResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/LocalNetworkTopologyResult.md b/thousandeyes-sdk-endpoint-test-results/docs/LocalNetworkTopologyResult.md index 9f5265fec..344aaaf7c 100644 --- a/thousandeyes-sdk-endpoint-test-results/docs/LocalNetworkTopologyResult.md +++ b/thousandeyes-sdk-endpoint-test-results/docs/LocalNetworkTopologyResult.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **is_icmp_blocked** | **bool** | Set to `true` if network target is blocking ICMP echo (ping) queries. | [optional] [readonly] **tcp_connect** | [**TcpConnect**](TcpConnect.md) | | [optional] **system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] -**coordinates** | [**RealUserTestCoordinates**](RealUserTestCoordinates.md) | | [optional] +**coordinates** | [**RealUserEndpointTestCoordinates**](RealUserEndpointTestCoordinates.md) | | [optional] **network_profile** | [**NetworkProfile**](NetworkProfile.md) | | [optional] **icmp_traceroute** | [**Traceroute**](Traceroute.md) | | [optional] **icmp_traceroutes** | [**List[Traceroute]**](Traceroute.md) | | [optional] diff --git a/thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdEndpointTestsDataRoundsSearch.md b/thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdEndpointTestsDataRoundsSearch.md new file mode 100644 index 000000000..8fe6e2602 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdEndpointTestsDataRoundsSearch.md @@ -0,0 +1,31 @@ +# MultiTestIdEndpointTestsDataRoundsSearch + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**search_sort** | [**List[EndpointTestsDataSearchSort]**](EndpointTestsDataSearchSort.md) | | [optional] +**threshold_filter** | [**EndpointTestsDataThresholdFilters**](EndpointTestsDataThresholdFilters.md) | | [optional] +**search_filters** | [**MultiTestIdEndpointTestsDataSearchFilter**](MultiTestIdEndpointTestsDataSearchFilter.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_endpoint_tests_data_rounds_search import MultiTestIdEndpointTestsDataRoundsSearch + +# TODO update the JSON string below +json = "{}" +# create an instance of MultiTestIdEndpointTestsDataRoundsSearch from a JSON string +multi_test_id_endpoint_tests_data_rounds_search_instance = MultiTestIdEndpointTestsDataRoundsSearch.from_json(json) +# print the JSON string representation of the object +print(MultiTestIdEndpointTestsDataRoundsSearch.to_json()) + +# convert the object into a dict +multi_test_id_endpoint_tests_data_rounds_search_dict = multi_test_id_endpoint_tests_data_rounds_search_instance.to_dict() +# create an instance of MultiTestIdEndpointTestsDataRoundsSearch from a dict +multi_test_id_endpoint_tests_data_rounds_search_from_dict = MultiTestIdEndpointTestsDataRoundsSearch.from_dict(multi_test_id_endpoint_tests_data_rounds_search_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdEndpointTestsDataSearchFilter.md b/thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdEndpointTestsDataSearchFilter.md new file mode 100644 index 000000000..30c45d270 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdEndpointTestsDataSearchFilter.md @@ -0,0 +1,30 @@ +# MultiTestIdEndpointTestsDataSearchFilter + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **List[str]** | Filter using the `agent-id`. | [optional] +**test_id** | **List[str]** | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_endpoint_tests_data_search_filter import MultiTestIdEndpointTestsDataSearchFilter + +# TODO update the JSON string below +json = "{}" +# create an instance of MultiTestIdEndpointTestsDataSearchFilter from a JSON string +multi_test_id_endpoint_tests_data_search_filter_instance = MultiTestIdEndpointTestsDataSearchFilter.from_json(json) +# print the JSON string representation of the object +print(MultiTestIdEndpointTestsDataSearchFilter.to_json()) + +# convert the object into a dict +multi_test_id_endpoint_tests_data_search_filter_dict = multi_test_id_endpoint_tests_data_search_filter_instance.to_dict() +# create an instance of MultiTestIdEndpointTestsDataSearchFilter from a dict +multi_test_id_endpoint_tests_data_search_filter_from_dict = MultiTestIdEndpointTestsDataSearchFilter.from_dict(multi_test_id_endpoint_tests_data_search_filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdNetworkEndpointTestResults.md b/thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdNetworkEndpointTestResults.md new file mode 100644 index 000000000..81e4a6495 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/MultiTestIdNetworkEndpointTestResults.md @@ -0,0 +1,33 @@ +# MultiTestIdNetworkEndpointTestResults + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[NetworkEndpointTestResult]**](NetworkEndpointTestResult.md) | | [optional] +**total_hits** | **int** | Total number of measurements that match the search criteria | [optional] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**links** | [**PaginationNextLink**](PaginationNextLink.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_network_endpoint_test_results import MultiTestIdNetworkEndpointTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of MultiTestIdNetworkEndpointTestResults from a JSON string +multi_test_id_network_endpoint_test_results_instance = MultiTestIdNetworkEndpointTestResults.from_json(json) +# print the JSON string representation of the object +print(MultiTestIdNetworkEndpointTestResults.to_json()) + +# convert the object into a dict +multi_test_id_network_endpoint_test_results_dict = multi_test_id_network_endpoint_test_results_instance.to_dict() +# create an instance of MultiTestIdNetworkEndpointTestResults from a dict +multi_test_id_network_endpoint_test_results_from_dict = MultiTestIdNetworkEndpointTestResults.from_dict(multi_test_id_network_endpoint_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicEndpointTestResult.md b/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicEndpointTestResult.md new file mode 100644 index 000000000..df1ece9d8 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicEndpointTestResult.md @@ -0,0 +1,49 @@ +# NetworkDynamicEndpointTestResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**test_id** | **str** | Unique ID of endpoint test. | [optional] [readonly] +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of target server. | [optional] [readonly] +**network_profile** | [**NetworkProfile**](NetworkProfile.md) | | [optional] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**original_target_profile** | [**TargetProfile**](TargetProfile.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] +**avg_latency** | **float** | Average RTT for packets sent to destination. | [optional] [readonly] +**error_details** | **str** | Error details, if an error was encountered. | [optional] [readonly] +**jitter** | **float** | Standard deviation of latency. | [optional] [readonly] +**is_icmp_blocked** | **bool** | Set to `true` if network target is blocking ICMP echo (ping) queries. | [optional] [readonly] +**loss** | **float** | Percentage of packets not reaching destination. | [optional] [readonly] +**max_latency** | **float** | Maximum RTT for packets sent to destination. | [optional] [readonly] +**min_latency** | **float** | Minimum RTT for packets sent to destination. | [optional] [readonly] +**application** | **str** | Which supported application to monitor, can be one of `webex`, `zoom`, `microsoft-teams`. | [optional] +**protocol** | [**EndpointTestResultProtocol**](EndpointTestResultProtocol.md) | | [optional] +**tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] +**udp_probe_mode** | [**UdpProbeModeResponse**](UdpProbeModeResponse.md) | | [optional] +**webex** | [**DynamicEndpointTestWebex**](DynamicEndpointTestWebex.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.network_dynamic_endpoint_test_result import NetworkDynamicEndpointTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkDynamicEndpointTestResult from a JSON string +network_dynamic_endpoint_test_result_instance = NetworkDynamicEndpointTestResult.from_json(json) +# print the JSON string representation of the object +print(NetworkDynamicEndpointTestResult.to_json()) + +# convert the object into a dict +network_dynamic_endpoint_test_result_dict = network_dynamic_endpoint_test_result_instance.to_dict() +# create an instance of NetworkDynamicEndpointTestResult from a dict +network_dynamic_endpoint_test_result_from_dict = NetworkDynamicEndpointTestResult.from_dict(network_dynamic_endpoint_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicEndpointTestResults.md b/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicEndpointTestResults.md new file mode 100644 index 000000000..7e29729eb --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicEndpointTestResults.md @@ -0,0 +1,34 @@ +# NetworkDynamicEndpointTestResults + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[NetworkDynamicEndpointTestResult]**](NetworkDynamicEndpointTestResult.md) | | [optional] +**test** | [**DynamicTest**](DynamicTest.md) | | [optional] +**total_hits** | **int** | Total number of measurements that match the search criteria | [optional] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**links** | [**PaginationNextLink**](PaginationNextLink.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.network_dynamic_endpoint_test_results import NetworkDynamicEndpointTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkDynamicEndpointTestResults from a JSON string +network_dynamic_endpoint_test_results_instance = NetworkDynamicEndpointTestResults.from_json(json) +# print the JSON string representation of the object +print(NetworkDynamicEndpointTestResults.to_json()) + +# convert the object into a dict +network_dynamic_endpoint_test_results_dict = network_dynamic_endpoint_test_results_instance.to_dict() +# create an instance of NetworkDynamicEndpointTestResults from a dict +network_dynamic_endpoint_test_results_from_dict = NetworkDynamicEndpointTestResults.from_dict(network_dynamic_endpoint_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicEndpointTestResultsApi.md b/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicEndpointTestResultsApi.md new file mode 100644 index 000000000..964704855 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/NetworkDynamicEndpointTestResultsApi.md @@ -0,0 +1,293 @@ +# thousandeyes_sdk.endpoint_test_results.NetworkDynamicEndpointTestResultsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**filter_dynamic_test_network_results**](NetworkDynamicEndpointTestResultsApi.md#filter_dynamic_test_network_results) | **POST** /endpoint/test-results/dynamic-tests/{testId}/network/filter | Retrieve network dynamic test results +[**get_dynamic_test_path_vis_agent_round_results**](NetworkDynamicEndpointTestResultsApi.md#get_dynamic_test_path_vis_agent_round_results) | **GET** /endpoint/test-results/dynamic-tests/{testId}/path-vis/agent/{agentId}/round/{roundId} | Retrieve path visualization network dynamic test results details +[**get_dynamic_test_path_vis_results**](NetworkDynamicEndpointTestResultsApi.md#get_dynamic_test_path_vis_results) | **GET** /endpoint/test-results/dynamic-tests/{testId}/path-vis | Retrieve path visualization network dynamic test results + + +# **filter_dynamic_test_network_results** +> NetworkDynamicEndpointTestResults filter_dynamic_test_network_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, dynamic_endpoint_tests_data_round_search=dynamic_endpoint_tests_data_round_search) + +Retrieve network dynamic test results + +Returns network metrics (`loss`, `latency`, `jitter` and `bandwidth`) from each endpoint agent, for each `roundId` in the requested window. When Time Frame is provided the rounds specific to the time frame is returned and the order is not pre-defined unless a user specifies the sort order in filter. When no time frame is provided the latest rounds are returned. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_test_results +from thousandeyes_sdk.endpoint_test_results.models.dynamic_endpoint_tests_data_round_search import DynamicEndpointTestsDataRoundSearch +from thousandeyes_sdk.endpoint_test_results.models.network_dynamic_endpoint_test_results import NetworkDynamicEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_test_results.NetworkDynamicEndpointTestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + dynamic_endpoint_tests_data_round_search = thousandeyes_sdk.endpoint_test_results.DynamicEndpointTestsDataRoundSearch() # DynamicEndpointTestsDataRoundSearch | Tests data search filters. (optional) + + try: + # Retrieve network dynamic test results + api_response = api_instance.filter_dynamic_test_network_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, dynamic_endpoint_tests_data_round_search=dynamic_endpoint_tests_data_round_search) + print("The response of NetworkDynamicEndpointTestResultsApi->filter_dynamic_test_network_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkDynamicEndpointTestResultsApi->filter_dynamic_test_network_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + **dynamic_endpoint_tests_data_round_search** | [**DynamicEndpointTestsDataRoundSearch**](DynamicEndpointTestsDataRoundSearch.md)| Tests data search filters. | [optional] + +### Return type + +[**NetworkDynamicEndpointTestResults**](NetworkDynamicEndpointTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_dynamic_test_path_vis_agent_round_results** +> PathVisDetailDynamicEndpointTestResults get_dynamic_test_path_vis_agent_round_results(test_id, agent_id, round_id, aid=aid) + +Retrieve path visualization network dynamic test results details + +Returns a hop-by-hop summary of the path trace data collected during path visualization. In each round, one path discovery attempt is made to reach the destination. The entire path is returned. A `roundId` must be specified. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_test_results +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_dynamic_endpoint_test_results import PathVisDetailDynamicEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_test_results.NetworkDynamicEndpointTestResultsApi(api_client) + test_id = '202701' # str | Test ID + agent_id = '11' # str | Agent ID + round_id = '1384309800' # str | Round ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Retrieve path visualization network dynamic test results details + api_response = api_instance.get_dynamic_test_path_vis_agent_round_results(test_id, agent_id, round_id, aid=aid) + print("The response of NetworkDynamicEndpointTestResultsApi->get_dynamic_test_path_vis_agent_round_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkDynamicEndpointTestResultsApi->get_dynamic_test_path_vis_agent_round_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **agent_id** | **str**| Agent ID | + **round_id** | **str**| Round ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**PathVisDetailDynamicEndpointTestResults**](PathVisDetailDynamicEndpointTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_dynamic_test_path_vis_results** +> PathVisDynamicEndpointTestResults get_dynamic_test_path_vis_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Retrieve path visualization network dynamic test results + +Returns a summary of the path visualization data collected from each endpoint agent to the destination. In each path visualization attempt, one attempt is made to reach the destination. Each set of data is summarized, based on response time, number of hops, and response time to the target. A time frame must be specified, or the most recent round within last 2 hours will be returned. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_test_results +from thousandeyes_sdk.endpoint_test_results.models.path_vis_dynamic_endpoint_test_results import PathVisDynamicEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_test_results.NetworkDynamicEndpointTestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + + try: + # Retrieve path visualization network dynamic test results + api_response = api_instance.get_dynamic_test_path_vis_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of NetworkDynamicEndpointTestResultsApi->get_dynamic_test_path_vis_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkDynamicEndpointTestResultsApi->get_dynamic_test_path_vis_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + +### Return type + +[**PathVisDynamicEndpointTestResults**](PathVisDynamicEndpointTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointScheduledTestResultsApi.md b/thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointScheduledTestResultsApi.md new file mode 100644 index 000000000..2687419d8 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointScheduledTestResultsApi.md @@ -0,0 +1,390 @@ +# thousandeyes_sdk.endpoint_test_results.NetworkEndpointScheduledTestResultsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**filter_scheduled_test_network_results**](NetworkEndpointScheduledTestResultsApi.md#filter_scheduled_test_network_results) | **POST** /endpoint/test-results/scheduled-tests/{testId}/network/filter | Retrieve network scheduled test results +[**filter_scheduled_tests_network_results**](NetworkEndpointScheduledTestResultsApi.md#filter_scheduled_tests_network_results) | **POST** /endpoint/test-results/scheduled-tests/network/filter | Retrieve network scheduled test results from multiple tests +[**get_scheduled_test_path_vis_agent_round_results**](NetworkEndpointScheduledTestResultsApi.md#get_scheduled_test_path_vis_agent_round_results) | **GET** /endpoint/test-results/scheduled-tests/{testId}/path-vis/agent/{agentId}/round/{roundId} | Retrieve path visualization network scheduled test results details +[**get_scheduled_test_path_vis_results**](NetworkEndpointScheduledTestResultsApi.md#get_scheduled_test_path_vis_results) | **GET** /endpoint/test-results/scheduled-tests/{testId}/path-vis | Retrieve path visualization network scheduled test results + + +# **filter_scheduled_test_network_results** +> NetworkEndpointTestResults filter_scheduled_test_network_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, endpoint_tests_data_rounds_search=endpoint_tests_data_rounds_search) + +Retrieve network scheduled test results + +Returns network metrics (loss, latency, and jitter) from each endpoint agent, for each roundId within the specified time window, as determined by search filters. If a time frame is provided, the rounds relevant to that time frame are returned, and the order is not predefined unless the user specifies a sort order in the filter. When no time frame is provided, the latest rounds are returned. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_test_results +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_rounds_search import EndpointTestsDataRoundsSearch +from thousandeyes_sdk.endpoint_test_results.models.network_endpoint_test_results import NetworkEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_test_results.NetworkEndpointScheduledTestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.EndpointTestsDataRoundsSearch() # EndpointTestsDataRoundsSearch | Tests data search filters. (optional) + + try: + # Retrieve network scheduled test results + api_response = api_instance.filter_scheduled_test_network_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, endpoint_tests_data_rounds_search=endpoint_tests_data_rounds_search) + print("The response of NetworkEndpointScheduledTestResultsApi->filter_scheduled_test_network_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkEndpointScheduledTestResultsApi->filter_scheduled_test_network_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + **endpoint_tests_data_rounds_search** | [**EndpointTestsDataRoundsSearch**](EndpointTestsDataRoundsSearch.md)| Tests data search filters. | [optional] + +### Return type + +[**NetworkEndpointTestResults**](NetworkEndpointTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **filter_scheduled_tests_network_results** +> MultiTestIdNetworkEndpointTestResults filter_scheduled_tests_network_results(aid=aid, window=window, start_date=start_date, end_date=end_date, max=max, cursor=cursor, multi_test_id_endpoint_tests_data_rounds_search=multi_test_id_endpoint_tests_data_rounds_search) + +Retrieve network scheduled test results from multiple tests + +Returns network metrics, including loss, latency, and jitter, for multiple test IDs obtained from each endpoint agent. It allows you to specify a time window using search filters to retrieve metrics for specific round IDs within that time frame. The default order of results is unspecified unless you include a sorting preference in the filter. When no time frame is provided, the API returns metrics for the most recent rounds. Access to all accounts associated with the specified test IDs is required to use this endpoint. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_test_results +from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_endpoint_tests_data_rounds_search import MultiTestIdEndpointTestsDataRoundsSearch +from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_network_endpoint_test_results import MultiTestIdNetworkEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_test_results.NetworkEndpointScheduledTestResultsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + max = 5 # int | (Optional) Maximum number of objects to return. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + multi_test_id_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.MultiTestIdEndpointTestsDataRoundsSearch() # MultiTestIdEndpointTestsDataRoundsSearch | Test data search filters. (optional) + + try: + # Retrieve network scheduled test results from multiple tests + api_response = api_instance.filter_scheduled_tests_network_results(aid=aid, window=window, start_date=start_date, end_date=end_date, max=max, cursor=cursor, multi_test_id_endpoint_tests_data_rounds_search=multi_test_id_endpoint_tests_data_rounds_search) + print("The response of NetworkEndpointScheduledTestResultsApi->filter_scheduled_tests_network_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkEndpointScheduledTestResultsApi->filter_scheduled_tests_network_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **max** | **int**| (Optional) Maximum number of objects to return. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + **multi_test_id_endpoint_tests_data_rounds_search** | [**MultiTestIdEndpointTestsDataRoundsSearch**](MultiTestIdEndpointTestsDataRoundsSearch.md)| Test data search filters. | [optional] + +### Return type + +[**MultiTestIdNetworkEndpointTestResults**](MultiTestIdNetworkEndpointTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_scheduled_test_path_vis_agent_round_results** +> PathVisDetailEndpointTestResults get_scheduled_test_path_vis_agent_round_results(test_id, agent_id, round_id, aid=aid) + +Retrieve path visualization network scheduled test results details + +Returns a hop-by-hop summary of the path trace data collected during path visualization. In each round, one path discovery attempt is made to reach the destination. The entire path is returned. A `roundId` must be specified. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_test_results +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_endpoint_test_results import PathVisDetailEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_test_results.NetworkEndpointScheduledTestResultsApi(api_client) + test_id = '202701' # str | Test ID + agent_id = '11' # str | Agent ID + round_id = '1384309800' # str | Round ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Retrieve path visualization network scheduled test results details + api_response = api_instance.get_scheduled_test_path_vis_agent_round_results(test_id, agent_id, round_id, aid=aid) + print("The response of NetworkEndpointScheduledTestResultsApi->get_scheduled_test_path_vis_agent_round_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkEndpointScheduledTestResultsApi->get_scheduled_test_path_vis_agent_round_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **agent_id** | **str**| Agent ID | + **round_id** | **str**| Round ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**PathVisDetailEndpointTestResults**](PathVisDetailEndpointTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_scheduled_test_path_vis_results** +> PathVisEndpointTestResults get_scheduled_test_path_vis_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Retrieve path visualization network scheduled test results + +Returns a summary of the path visualization data collected from each endpoint agent to the destination. In each path visualization attempt, one attempt is made to reach the destination. Each set of data is summarized, based on response time, number of hops, and response time to the target. A time frame must be specified, or the most recent round within last 2 hours is returned. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_test_results +from thousandeyes_sdk.endpoint_test_results.models.path_vis_endpoint_test_results import PathVisEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_test_results.NetworkEndpointScheduledTestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + + try: + # Retrieve path visualization network scheduled test results + api_response = api_instance.get_scheduled_test_path_vis_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of NetworkEndpointScheduledTestResultsApi->get_scheduled_test_path_vis_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkEndpointScheduledTestResultsApi->get_scheduled_test_path_vis_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + +### Return type + +[**PathVisEndpointTestResults**](PathVisEndpointTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointTestResult.md b/thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointTestResult.md new file mode 100644 index 000000000..af556c641 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointTestResult.md @@ -0,0 +1,44 @@ +# NetworkEndpointTestResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**test_id** | **str** | Unique ID of endpoint test. | [optional] [readonly] +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of target server. | [optional] [readonly] +**network_profile** | [**NetworkProfile**](NetworkProfile.md) | | [optional] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**original_target_profile** | [**TargetProfile**](TargetProfile.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] +**avg_latency** | **float** | Average RTT for packets sent to destination. | [optional] [readonly] +**error_details** | **str** | Error details, if an error was encountered. | [optional] [readonly] +**jitter** | **float** | Standard deviation of latency. | [optional] [readonly] +**is_icmp_blocked** | **bool** | Set to `true` if network target is blocking ICMP echo (ping) queries. | [optional] [readonly] +**loss** | **float** | Percentage of packets not reaching destination. | [optional] [readonly] +**max_latency** | **float** | Maximum RTT for packets sent to destination. | [optional] [readonly] +**min_latency** | **float** | Minimum RTT for packets sent to destination. | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.network_endpoint_test_result import NetworkEndpointTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkEndpointTestResult from a JSON string +network_endpoint_test_result_instance = NetworkEndpointTestResult.from_json(json) +# print the JSON string representation of the object +print(NetworkEndpointTestResult.to_json()) + +# convert the object into a dict +network_endpoint_test_result_dict = network_endpoint_test_result_instance.to_dict() +# create an instance of NetworkEndpointTestResult from a dict +network_endpoint_test_result_from_dict = NetworkEndpointTestResult.from_dict(network_endpoint_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointTestResults.md b/thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointTestResults.md new file mode 100644 index 000000000..4200a09e7 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/NetworkEndpointTestResults.md @@ -0,0 +1,34 @@ +# NetworkEndpointTestResults + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[NetworkEndpointTestResult]**](NetworkEndpointTestResult.md) | | [optional] +**total_hits** | **int** | Total number of measurements that match the search criteria | [optional] +**test** | [**EndpointScheduledTest**](EndpointScheduledTest.md) | | [optional] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**links** | [**PaginationNextLink**](PaginationNextLink.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.network_endpoint_test_results import NetworkEndpointTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkEndpointTestResults from a JSON string +network_endpoint_test_results_instance = NetworkEndpointTestResults.from_json(json) +# print the JSON string representation of the object +print(NetworkEndpointTestResults.to_json()) + +# convert the object into a dict +network_endpoint_test_results_dict = network_endpoint_test_results_instance.to_dict() +# create an instance of NetworkEndpointTestResults from a dict +network_endpoint_test_results_from_dict = NetworkEndpointTestResults.from_dict(network_endpoint_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/NetworkProfile.md b/thousandeyes-sdk-endpoint-test-results/docs/NetworkProfile.md index fee4e41dd..da4e00c7a 100644 --- a/thousandeyes-sdk-endpoint-test-results/docs/NetworkProfile.md +++ b/thousandeyes-sdk-endpoint-test-results/docs/NetworkProfile.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes **gateway** | **str** | Network gateway address. | [optional] [readonly] **wireless_profile** | [**NetworkWirelessProfile**](NetworkWirelessProfile.md) | | [optional] **proxy_profile** | [**NetworkProxyProfile**](NetworkProxyProfile.md) | | [optional] -**ethernet_profile** | [**EthernetProfile**](EthernetProfile.md) | | [optional] +**ethernet_profile** | [**EndpointTestEthernetProfile**](EndpointTestEthernetProfile.md) | | [optional] **previous_interface** | [**NetworkInterface**](NetworkInterface.md) | | [optional] ## Example diff --git a/thousandeyes-sdk-endpoint-test-results/docs/PathVisBaseEndpointTestResult.md b/thousandeyes-sdk-endpoint-test-results/docs/PathVisBaseEndpointTestResult.md new file mode 100644 index 000000000..cf7d7e6b9 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/PathVisBaseEndpointTestResult.md @@ -0,0 +1,41 @@ +# PathVisBaseEndpointTestResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**test_id** | **str** | Unique ID of endpoint test. | [optional] [readonly] +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of target server. | [optional] [readonly] +**network_profile** | [**NetworkProfile**](NetworkProfile.md) | | [optional] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**original_target_profile** | [**TargetProfile**](TargetProfile.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] +**asn_details** | [**AsnDetails**](AsnDetails.md) | | [optional] +**server** | **str** | Target server, including port. | [optional] [readonly] +**source_ip** | **str** | IP address of source endpoint agent. | [optional] [readonly] +**source_prefix** | **str** | IP prefix of source endpoint agent. | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.path_vis_base_endpoint_test_result import PathVisBaseEndpointTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisBaseEndpointTestResult from a JSON string +path_vis_base_endpoint_test_result_instance = PathVisBaseEndpointTestResult.from_json(json) +# print the JSON string representation of the object +print(PathVisBaseEndpointTestResult.to_json()) + +# convert the object into a dict +path_vis_base_endpoint_test_result_dict = path_vis_base_endpoint_test_result_instance.to_dict() +# create an instance of PathVisBaseEndpointTestResult from a dict +path_vis_base_endpoint_test_result_from_dict = PathVisBaseEndpointTestResult.from_dict(path_vis_base_endpoint_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailDynamicEndpointTestResult.md b/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailDynamicEndpointTestResult.md new file mode 100644 index 000000000..88d113629 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailDynamicEndpointTestResult.md @@ -0,0 +1,48 @@ +# PathVisDetailDynamicEndpointTestResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**test_id** | **str** | Unique ID of endpoint test. | [optional] [readonly] +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of target server. | [optional] [readonly] +**network_profile** | [**NetworkProfile**](NetworkProfile.md) | | [optional] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**original_target_profile** | [**TargetProfile**](TargetProfile.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] +**asn_details** | [**AsnDetails**](AsnDetails.md) | | [optional] +**server** | **str** | Target server, including port. | [optional] [readonly] +**source_ip** | **str** | IP address of source endpoint agent. | [optional] [readonly] +**source_prefix** | **str** | IP prefix of source endpoint agent. | [optional] [readonly] +**path_traces** | [**List[EndpointPathVisRoute]**](EndpointPathVisRoute.md) | Shows iterations of path trace, with each iteration specified by a pathId. | [optional] +**vpn_path_traces** | [**List[EndpointPathVisRoute]**](EndpointPathVisRoute.md) | Shows iterations of the VPN path trace, with each iteration specified by a pathId. | [optional] +**application** | **str** | Which supported application to monitor, can be one of `webex`, `zoom`, `microsoft-teams`. | [optional] +**protocol** | [**EndpointTestResultProtocol**](EndpointTestResultProtocol.md) | | [optional] +**tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] +**udp_probe_mode** | [**UdpProbeModeResponse**](UdpProbeModeResponse.md) | | [optional] +**webex** | [**DynamicEndpointTestWebex**](DynamicEndpointTestWebex.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_dynamic_endpoint_test_result import PathVisDetailDynamicEndpointTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisDetailDynamicEndpointTestResult from a JSON string +path_vis_detail_dynamic_endpoint_test_result_instance = PathVisDetailDynamicEndpointTestResult.from_json(json) +# print the JSON string representation of the object +print(PathVisDetailDynamicEndpointTestResult.to_json()) + +# convert the object into a dict +path_vis_detail_dynamic_endpoint_test_result_dict = path_vis_detail_dynamic_endpoint_test_result_instance.to_dict() +# create an instance of PathVisDetailDynamicEndpointTestResult from a dict +path_vis_detail_dynamic_endpoint_test_result_from_dict = PathVisDetailDynamicEndpointTestResult.from_dict(path_vis_detail_dynamic_endpoint_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailDynamicEndpointTestResults.md b/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailDynamicEndpointTestResults.md new file mode 100644 index 000000000..e77cbabd9 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailDynamicEndpointTestResults.md @@ -0,0 +1,31 @@ +# PathVisDetailDynamicEndpointTestResults + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PathVisDetailDynamicEndpointTestResult]**](PathVisDetailDynamicEndpointTestResult.md) | | [optional] +**test** | [**DynamicTest**](DynamicTest.md) | | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_dynamic_endpoint_test_results import PathVisDetailDynamicEndpointTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisDetailDynamicEndpointTestResults from a JSON string +path_vis_detail_dynamic_endpoint_test_results_instance = PathVisDetailDynamicEndpointTestResults.from_json(json) +# print the JSON string representation of the object +print(PathVisDetailDynamicEndpointTestResults.to_json()) + +# convert the object into a dict +path_vis_detail_dynamic_endpoint_test_results_dict = path_vis_detail_dynamic_endpoint_test_results_instance.to_dict() +# create an instance of PathVisDetailDynamicEndpointTestResults from a dict +path_vis_detail_dynamic_endpoint_test_results_from_dict = PathVisDetailDynamicEndpointTestResults.from_dict(path_vis_detail_dynamic_endpoint_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailEndpointTestResult.md b/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailEndpointTestResult.md new file mode 100644 index 000000000..9aa5482da --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailEndpointTestResult.md @@ -0,0 +1,43 @@ +# PathVisDetailEndpointTestResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**test_id** | **str** | Unique ID of endpoint test. | [optional] [readonly] +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of target server. | [optional] [readonly] +**network_profile** | [**NetworkProfile**](NetworkProfile.md) | | [optional] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**original_target_profile** | [**TargetProfile**](TargetProfile.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] +**asn_details** | [**AsnDetails**](AsnDetails.md) | | [optional] +**server** | **str** | Target server, including port. | [optional] [readonly] +**source_ip** | **str** | IP address of source endpoint agent. | [optional] [readonly] +**source_prefix** | **str** | IP prefix of source endpoint agent. | [optional] [readonly] +**path_traces** | [**List[EndpointPathVisRoute]**](EndpointPathVisRoute.md) | Shows iterations of path trace, with each iteration specified by a pathId. | [optional] +**vpn_path_traces** | [**List[EndpointPathVisRoute]**](EndpointPathVisRoute.md) | Shows iterations of the VPN path trace, with each iteration specified by a pathId. | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_endpoint_test_result import PathVisDetailEndpointTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisDetailEndpointTestResult from a JSON string +path_vis_detail_endpoint_test_result_instance = PathVisDetailEndpointTestResult.from_json(json) +# print the JSON string representation of the object +print(PathVisDetailEndpointTestResult.to_json()) + +# convert the object into a dict +path_vis_detail_endpoint_test_result_dict = path_vis_detail_endpoint_test_result_instance.to_dict() +# create an instance of PathVisDetailEndpointTestResult from a dict +path_vis_detail_endpoint_test_result_from_dict = PathVisDetailEndpointTestResult.from_dict(path_vis_detail_endpoint_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailEndpointTestResults.md b/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailEndpointTestResults.md new file mode 100644 index 000000000..7437365d9 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/PathVisDetailEndpointTestResults.md @@ -0,0 +1,31 @@ +# PathVisDetailEndpointTestResults + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PathVisDetailEndpointTestResult]**](PathVisDetailEndpointTestResult.md) | | [optional] +**test** | [**EndpointScheduledTest**](EndpointScheduledTest.md) | | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_endpoint_test_results import PathVisDetailEndpointTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisDetailEndpointTestResults from a JSON string +path_vis_detail_endpoint_test_results_instance = PathVisDetailEndpointTestResults.from_json(json) +# print the JSON string representation of the object +print(PathVisDetailEndpointTestResults.to_json()) + +# convert the object into a dict +path_vis_detail_endpoint_test_results_dict = path_vis_detail_endpoint_test_results_instance.to_dict() +# create an instance of PathVisDetailEndpointTestResults from a dict +path_vis_detail_endpoint_test_results_from_dict = PathVisDetailEndpointTestResults.from_dict(path_vis_detail_endpoint_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/PathVisDynamicEndpointTestResult.md b/thousandeyes-sdk-endpoint-test-results/docs/PathVisDynamicEndpointTestResult.md new file mode 100644 index 000000000..6f1f995e9 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/PathVisDynamicEndpointTestResult.md @@ -0,0 +1,48 @@ +# PathVisDynamicEndpointTestResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**test_id** | **str** | Unique ID of endpoint test. | [optional] [readonly] +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of target server. | [optional] [readonly] +**network_profile** | [**NetworkProfile**](NetworkProfile.md) | | [optional] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**original_target_profile** | [**TargetProfile**](TargetProfile.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] +**asn_details** | [**AsnDetails**](AsnDetails.md) | | [optional] +**server** | **str** | Target server, including port. | [optional] [readonly] +**source_ip** | **str** | IP address of source endpoint agent. | [optional] [readonly] +**source_prefix** | **str** | IP prefix of source endpoint agent. | [optional] [readonly] +**application** | **str** | Which supported application to monitor, can be one of `webex`, `zoom`, `microsoft-teams`. | [optional] +**protocol** | [**EndpointTestResultProtocol**](EndpointTestResultProtocol.md) | | [optional] +**tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] +**udp_probe_mode** | [**UdpProbeModeResponse**](UdpProbeModeResponse.md) | | [optional] +**webex** | [**DynamicEndpointTestWebex**](DynamicEndpointTestWebex.md) | | [optional] +**location** | **str** | Geographic location of the path visualization. | [optional] [readonly] +**path_traces** | [**List[EndpointPathTrace]**](EndpointPathTrace.md) | Shows an iteration of path trace, with each iteration specified by a pathId. | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.path_vis_dynamic_endpoint_test_result import PathVisDynamicEndpointTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisDynamicEndpointTestResult from a JSON string +path_vis_dynamic_endpoint_test_result_instance = PathVisDynamicEndpointTestResult.from_json(json) +# print the JSON string representation of the object +print(PathVisDynamicEndpointTestResult.to_json()) + +# convert the object into a dict +path_vis_dynamic_endpoint_test_result_dict = path_vis_dynamic_endpoint_test_result_instance.to_dict() +# create an instance of PathVisDynamicEndpointTestResult from a dict +path_vis_dynamic_endpoint_test_result_from_dict = PathVisDynamicEndpointTestResult.from_dict(path_vis_dynamic_endpoint_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/PathVisDynamicEndpointTestResults.md b/thousandeyes-sdk-endpoint-test-results/docs/PathVisDynamicEndpointTestResults.md new file mode 100644 index 000000000..76be7d5a6 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/PathVisDynamicEndpointTestResults.md @@ -0,0 +1,34 @@ +# PathVisDynamicEndpointTestResults + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PathVisDynamicEndpointTestResult]**](PathVisDynamicEndpointTestResult.md) | | [optional] +**test** | [**DynamicTest**](DynamicTest.md) | | [optional] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**total_hits** | **int** | Total number of measurements that match the search criteria | [optional] +**links** | [**PaginationNextAndSelfLink**](PaginationNextAndSelfLink.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.path_vis_dynamic_endpoint_test_results import PathVisDynamicEndpointTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisDynamicEndpointTestResults from a JSON string +path_vis_dynamic_endpoint_test_results_instance = PathVisDynamicEndpointTestResults.from_json(json) +# print the JSON string representation of the object +print(PathVisDynamicEndpointTestResults.to_json()) + +# convert the object into a dict +path_vis_dynamic_endpoint_test_results_dict = path_vis_dynamic_endpoint_test_results_instance.to_dict() +# create an instance of PathVisDynamicEndpointTestResults from a dict +path_vis_dynamic_endpoint_test_results_from_dict = PathVisDynamicEndpointTestResults.from_dict(path_vis_dynamic_endpoint_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/PathVisEndpointTestResult.md b/thousandeyes-sdk-endpoint-test-results/docs/PathVisEndpointTestResult.md new file mode 100644 index 000000000..11e56387d --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/PathVisEndpointTestResult.md @@ -0,0 +1,43 @@ +# PathVisEndpointTestResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**test_id** | **str** | Unique ID of endpoint test. | [optional] [readonly] +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**server_ip** | **str** | IP address of target server. | [optional] [readonly] +**network_profile** | [**NetworkProfile**](NetworkProfile.md) | | [optional] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**original_target_profile** | [**TargetProfile**](TargetProfile.md) | | [optional] +**vpn_profile** | [**VpnProfile**](VpnProfile.md) | | [optional] +**asn_details** | [**AsnDetails**](AsnDetails.md) | | [optional] +**server** | **str** | Target server, including port. | [optional] [readonly] +**source_ip** | **str** | IP address of source endpoint agent. | [optional] [readonly] +**source_prefix** | **str** | IP prefix of source endpoint agent. | [optional] [readonly] +**location** | **str** | Geographic location of the path visualization. | [optional] [readonly] +**path_traces** | [**List[EndpointPathTrace]**](EndpointPathTrace.md) | Shows an iteration of path trace, with each iteration specified by a pathId. | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.path_vis_endpoint_test_result import PathVisEndpointTestResult + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisEndpointTestResult from a JSON string +path_vis_endpoint_test_result_instance = PathVisEndpointTestResult.from_json(json) +# print the JSON string representation of the object +print(PathVisEndpointTestResult.to_json()) + +# convert the object into a dict +path_vis_endpoint_test_result_dict = path_vis_endpoint_test_result_instance.to_dict() +# create an instance of PathVisEndpointTestResult from a dict +path_vis_endpoint_test_result_from_dict = PathVisEndpointTestResult.from_dict(path_vis_endpoint_test_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/PathVisEndpointTestResults.md b/thousandeyes-sdk-endpoint-test-results/docs/PathVisEndpointTestResults.md new file mode 100644 index 000000000..621a8b827 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/PathVisEndpointTestResults.md @@ -0,0 +1,33 @@ +# PathVisEndpointTestResults + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PathVisEndpointTestResult]**](PathVisEndpointTestResult.md) | | [optional] +**test** | [**EndpointScheduledTest**](EndpointScheduledTest.md) | | [optional] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**links** | [**PaginationNextAndSelfLink**](PaginationNextAndSelfLink.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.path_vis_endpoint_test_results import PathVisEndpointTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of PathVisEndpointTestResults from a JSON string +path_vis_endpoint_test_results_instance = PathVisEndpointTestResults.from_json(json) +# print the JSON string representation of the object +print(PathVisEndpointTestResults.to_json()) + +# convert the object into a dict +path_vis_endpoint_test_results_dict = path_vis_endpoint_test_results_instance.to_dict() +# create an instance of PathVisEndpointTestResults from a dict +path_vis_endpoint_test_results_from_dict = PathVisEndpointTestResults.from_dict(path_vis_endpoint_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/Platform.md b/thousandeyes-sdk-endpoint-test-results/docs/Platform.md index 97f29ba74..df59b607c 100644 --- a/thousandeyes-sdk-endpoint-test-results/docs/Platform.md +++ b/thousandeyes-sdk-endpoint-test-results/docs/Platform.md @@ -1,6 +1,6 @@ # Platform -OS platform types +OS platform types. Platform \"linux\" was recently renamed to \"roomos\". ## Properties diff --git a/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTest.md b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTest.md new file mode 100644 index 000000000..4a322eeaa --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTest.md @@ -0,0 +1,41 @@ +# RealUserEndpointTest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**committed** | **datetime** | UTC date when endpoint real user test was committed to the controller (ISO date-time format). | [optional] [readonly] +**var_date** | **datetime** | UTC date when endpoint real user test took place (ISO date-time format). | [optional] [readonly] +**experience_score** | **float** | Score rating a user’s experience when loading a particular page, from 0 (the worst) to 1 (the best). [More details](https://docs.thousandeyes.com/product-documentation/end-user-monitoring/viewing-data/endpoint-agent-views-reference#user-experience-score). | [optional] [readonly] +**number_of_pages** | **int** | Number of web pages visited on target website. | [optional] [readonly] +**organization_name** | **str** | Name of the AS organization `sourceAddress` belongs to. | [optional] [readonly] +**port** | **int** | Port used to visit target website. | [optional] [readonly] +**protocol** | **str** | Protocol used to visit target website. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**source_address** | **str** | Public IP address of the endpoint agent during the session. | [optional] [readonly] +**id** | **str** | Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID. | [optional] [readonly] +**visited_site** | **str** | Domain used to visit target website. | [optional] [readonly] +**page_id** | **str** | Web page ID. The page ID is unique only within an endpoint real user test. | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test import RealUserEndpointTest + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserEndpointTest from a JSON string +real_user_endpoint_test_instance = RealUserEndpointTest.from_json(json) +# print the JSON string representation of the object +print(RealUserEndpointTest.to_json()) + +# convert the object into a dict +real_user_endpoint_test_dict = real_user_endpoint_test_instance.to_dict() +# create an instance of RealUserEndpointTest from a dict +real_user_endpoint_test_from_dict = RealUserEndpointTest.from_dict(real_user_endpoint_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestBase.md b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestBase.md new file mode 100644 index 000000000..182717005 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestBase.md @@ -0,0 +1,40 @@ +# RealUserEndpointTestBase + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**committed** | **datetime** | UTC date when endpoint real user test was committed to the controller (ISO date-time format). | [optional] [readonly] +**var_date** | **datetime** | UTC date when endpoint real user test took place (ISO date-time format). | [optional] [readonly] +**experience_score** | **float** | Score rating a user’s experience when loading a particular page, from 0 (the worst) to 1 (the best). [More details](https://docs.thousandeyes.com/product-documentation/end-user-monitoring/viewing-data/endpoint-agent-views-reference#user-experience-score). | [optional] [readonly] +**number_of_pages** | **int** | Number of web pages visited on target website. | [optional] [readonly] +**organization_name** | **str** | Name of the AS organization `sourceAddress` belongs to. | [optional] [readonly] +**port** | **int** | Port used to visit target website. | [optional] [readonly] +**protocol** | **str** | Protocol used to visit target website. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**source_address** | **str** | Public IP address of the endpoint agent during the session. | [optional] [readonly] +**id** | **str** | Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID. | [optional] [readonly] +**visited_site** | **str** | Domain used to visit target website. | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_base import RealUserEndpointTestBase + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserEndpointTestBase from a JSON string +real_user_endpoint_test_base_instance = RealUserEndpointTestBase.from_json(json) +# print the JSON string representation of the object +print(RealUserEndpointTestBase.to_json()) + +# convert the object into a dict +real_user_endpoint_test_base_dict = real_user_endpoint_test_base_instance.to_dict() +# create an instance of RealUserEndpointTestBase from a dict +real_user_endpoint_test_base_from_dict = RealUserEndpointTestBase.from_dict(real_user_endpoint_test_base_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestCoordinates.md b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestCoordinates.md new file mode 100644 index 000000000..7b87a7db8 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestCoordinates.md @@ -0,0 +1,32 @@ +# RealUserEndpointTestCoordinates + +Contains approximate GPS location of the endpoint agent, based on endpoint agent’s public IP address. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**latitude** | **float** | Numeric representations of GPS coordinates. | [optional] [readonly] +**location** | **str** | Represents named geographical location. | [optional] [readonly] +**longitude** | **float** | Numeric representations of GPS coordinates. | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_coordinates import RealUserEndpointTestCoordinates + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserEndpointTestCoordinates from a JSON string +real_user_endpoint_test_coordinates_instance = RealUserEndpointTestCoordinates.from_json(json) +# print the JSON string representation of the object +print(RealUserEndpointTestCoordinates.to_json()) + +# convert the object into a dict +real_user_endpoint_test_coordinates_dict = real_user_endpoint_test_coordinates_instance.to_dict() +# create an instance of RealUserEndpointTestCoordinates from a dict +real_user_endpoint_test_coordinates_from_dict = RealUserEndpointTestCoordinates.from_dict(real_user_endpoint_test_coordinates_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestDetail.md b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestDetail.md new file mode 100644 index 000000000..f318a1237 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestDetail.md @@ -0,0 +1,44 @@ +# RealUserEndpointTestDetail + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**committed** | **datetime** | UTC date when endpoint real user test was committed to the controller (ISO date-time format). | [optional] [readonly] +**var_date** | **datetime** | UTC date when endpoint real user test took place (ISO date-time format). | [optional] [readonly] +**experience_score** | **float** | Score rating a user’s experience when loading a particular page, from 0 (the worst) to 1 (the best). [More details](https://docs.thousandeyes.com/product-documentation/end-user-monitoring/viewing-data/endpoint-agent-views-reference#user-experience-score). | [optional] [readonly] +**number_of_pages** | **int** | Number of web pages visited on target website. | [optional] [readonly] +**organization_name** | **str** | Name of the AS organization `sourceAddress` belongs to. | [optional] [readonly] +**port** | **int** | Port used to visit target website. | [optional] [readonly] +**protocol** | **str** | Protocol used to visit target website. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**source_address** | **str** | Public IP address of the endpoint agent during the session. | [optional] [readonly] +**id** | **str** | Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID. | [optional] [readonly] +**visited_site** | **str** | Domain used to visit target website. | [optional] [readonly] +**browser** | [**EndpointBrowser**](EndpointBrowser.md) | | [optional] +**coordinates** | [**RealUserEndpointTestCoordinates**](RealUserEndpointTestCoordinates.md) | | [optional] +**pages** | [**List[RealUserEndpointTestPage]**](RealUserEndpointTestPage.md) | Web site base domain visited during the session. | [optional] +**network** | [**RealUserEndpointTestNetwork**](RealUserEndpointTestNetwork.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_detail import RealUserEndpointTestDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserEndpointTestDetail from a JSON string +real_user_endpoint_test_detail_instance = RealUserEndpointTestDetail.from_json(json) +# print the JSON string representation of the object +print(RealUserEndpointTestDetail.to_json()) + +# convert the object into a dict +real_user_endpoint_test_detail_dict = real_user_endpoint_test_detail_instance.to_dict() +# create an instance of RealUserEndpointTestDetail from a dict +real_user_endpoint_test_detail_from_dict = RealUserEndpointTestDetail.from_dict(real_user_endpoint_test_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestDetailResults.md b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestDetailResults.md new file mode 100644 index 000000000..983c582f7 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestDetailResults.md @@ -0,0 +1,30 @@ +# RealUserEndpointTestDetailResults + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[RealUserEndpointTestDetail]**](RealUserEndpointTestDetail.md) | | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_detail_results import RealUserEndpointTestDetailResults + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserEndpointTestDetailResults from a JSON string +real_user_endpoint_test_detail_results_instance = RealUserEndpointTestDetailResults.from_json(json) +# print the JSON string representation of the object +print(RealUserEndpointTestDetailResults.to_json()) + +# convert the object into a dict +real_user_endpoint_test_detail_results_dict = real_user_endpoint_test_detail_results_instance.to_dict() +# create an instance of RealUserEndpointTestDetailResults from a dict +real_user_endpoint_test_detail_results_from_dict = RealUserEndpointTestDetailResults.from_dict(real_user_endpoint_test_detail_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestNetwork.md b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestNetwork.md new file mode 100644 index 000000000..13cc3f610 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestNetwork.md @@ -0,0 +1,39 @@ +# RealUserEndpointTestNetwork + +Contains details about network profile and conditions during session. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**network_profile** | [**NetworkProfile**](NetworkProfile.md) | | [optional] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] +**gateway_ping** | [**GatewayNetworkPing**](GatewayNetworkPing.md) | | [optional] +**ping** | [**TargetNetworkPing**](TargetNetworkPing.md) | | [optional] +**traceroute** | [**TargetTraceroute**](TargetTraceroute.md) | | [optional] +**connect_rtt** | **float** | Represents the number of milliseconds required to establish TCP connectivity with the target. | [optional] [readonly] +**is_icmp_blocked** | **bool** | Set to `true` if network target is blocking ICMP echo (ping) queries. | [optional] [readonly] +**errors** | **List[str]** | Array of string representing possible network errors. | [optional] [readonly] +**vpn_ping** | [**VpnNetworkPing**](VpnNetworkPing.md) | | [optional] +**vpn_traceroute** | [**VpnTraceroute**](VpnTraceroute.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_network import RealUserEndpointTestNetwork + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserEndpointTestNetwork from a JSON string +real_user_endpoint_test_network_instance = RealUserEndpointTestNetwork.from_json(json) +# print the JSON string representation of the object +print(RealUserEndpointTestNetwork.to_json()) + +# convert the object into a dict +real_user_endpoint_test_network_dict = real_user_endpoint_test_network_instance.to_dict() +# create an instance of RealUserEndpointTestNetwork from a dict +real_user_endpoint_test_network_from_dict = RealUserEndpointTestNetwork.from_dict(real_user_endpoint_test_network_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestNetworkResult.md b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestNetworkResult.md new file mode 100644 index 000000000..da62371c0 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestNetworkResult.md @@ -0,0 +1,36 @@ +# RealUserEndpointTestNetworkResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**var_date** | **datetime** | UTC date when endpoint real user test took place (ISO date-time format). | [optional] [readonly] +**id** | **str** | Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**destination** | [**NetworkMetrics**](NetworkMetrics.md) | | [optional] +**vpn** | [**NetworkMetrics**](NetworkMetrics.md) | | [optional] +**proxy** | [**NetworkMetrics**](NetworkMetrics.md) | | [optional] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_network_result import RealUserEndpointTestNetworkResult + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserEndpointTestNetworkResult from a JSON string +real_user_endpoint_test_network_result_instance = RealUserEndpointTestNetworkResult.from_json(json) +# print the JSON string representation of the object +print(RealUserEndpointTestNetworkResult.to_json()) + +# convert the object into a dict +real_user_endpoint_test_network_result_dict = real_user_endpoint_test_network_result_instance.to_dict() +# create an instance of RealUserEndpointTestNetworkResult from a dict +real_user_endpoint_test_network_result_from_dict = RealUserEndpointTestNetworkResult.from_dict(real_user_endpoint_test_network_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestNetworkResults.md b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestNetworkResults.md new file mode 100644 index 000000000..f21dd8e8e --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestNetworkResults.md @@ -0,0 +1,32 @@ +# RealUserEndpointTestNetworkResults + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[RealUserEndpointTestNetworkResult]**](RealUserEndpointTestNetworkResult.md) | | [optional] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**links** | [**PaginationNextLink**](PaginationNextLink.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_network_results import RealUserEndpointTestNetworkResults + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserEndpointTestNetworkResults from a JSON string +real_user_endpoint_test_network_results_instance = RealUserEndpointTestNetworkResults.from_json(json) +# print the JSON string representation of the object +print(RealUserEndpointTestNetworkResults.to_json()) + +# convert the object into a dict +real_user_endpoint_test_network_results_dict = real_user_endpoint_test_network_results_instance.to_dict() +# create an instance of RealUserEndpointTestNetworkResults from a dict +real_user_endpoint_test_network_results_from_dict = RealUserEndpointTestNetworkResults.from_dict(real_user_endpoint_test_network_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPage.md b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPage.md new file mode 100644 index 000000000..4faa1277d --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPage.md @@ -0,0 +1,34 @@ +# RealUserEndpointTestPage + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page_id** | **str** | Web page ID. The page ID is unique only within an endpoint real user test. | [optional] [readonly] +**page_title** | **str** | Web page title. | [optional] [readonly] +**page_url** | **str** | Web page url | [optional] [readonly] +**load_date** | **datetime** | UTC date when page load started (ISO date-time format). | [optional] [readonly] +**response_code** | **int** | HTTP response code. | [optional] [readonly] +**page_timings** | [**RealUserEndpointTestPageTimings**](RealUserEndpointTestPageTimings.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page import RealUserEndpointTestPage + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserEndpointTestPage from a JSON string +real_user_endpoint_test_page_instance = RealUserEndpointTestPage.from_json(json) +# print the JSON string representation of the object +print(RealUserEndpointTestPage.to_json()) + +# convert the object into a dict +real_user_endpoint_test_page_dict = real_user_endpoint_test_page_instance.to_dict() +# create an instance of RealUserEndpointTestPage from a dict +real_user_endpoint_test_page_from_dict = RealUserEndpointTestPage.from_dict(real_user_endpoint_test_page_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageDetailResult.md b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageDetailResult.md new file mode 100644 index 000000000..5fc8e3388 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageDetailResult.md @@ -0,0 +1,30 @@ +# RealUserEndpointTestPageDetailResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**har** | **object** | A HAR object according to the [HTTP Archive 1.2 specifications](http://www.softwareishard.com/blog/har-12-spec/), with an additional `systemMetrics` property. | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_detail_result import RealUserEndpointTestPageDetailResult + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserEndpointTestPageDetailResult from a JSON string +real_user_endpoint_test_page_detail_result_instance = RealUserEndpointTestPageDetailResult.from_json(json) +# print the JSON string representation of the object +print(RealUserEndpointTestPageDetailResult.to_json()) + +# convert the object into a dict +real_user_endpoint_test_page_detail_result_dict = real_user_endpoint_test_page_detail_result_instance.to_dict() +# create an instance of RealUserEndpointTestPageDetailResult from a dict +real_user_endpoint_test_page_detail_result_from_dict = RealUserEndpointTestPageDetailResult.from_dict(real_user_endpoint_test_page_detail_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageResult.md b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageResult.md new file mode 100644 index 000000000..e2f90206a --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageResult.md @@ -0,0 +1,39 @@ +# RealUserEndpointTestPageResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page_id** | **str** | Web page ID. The page ID is unique only within an endpoint real user test. | [optional] [readonly] +**page_title** | **str** | Web page title. | [optional] [readonly] +**page_url** | **str** | Web page url | [optional] [readonly] +**load_date** | **datetime** | UTC date when page load started (ISO date-time format). | [optional] [readonly] +**response_code** | **int** | HTTP response code. | [optional] [readonly] +**page_timings** | [**RealUserEndpointTestPageTimings**](RealUserEndpointTestPageTimings.md) | | [optional] +**agent_id** | **str** | Unique ID of endpoint agent, from `/endpoint/agents` endpoint. | [optional] [readonly] +**id** | **str** | Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID. | [optional] [readonly] +**round_id** | **int** | Epoch time (seconds) indicating the start time of the round. | [optional] [readonly] +**response_time** | **int** | HTTP server response in milliseconds. | [optional] [readonly] +**system_metrics** | [**SystemMetrics**](SystemMetrics.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_result import RealUserEndpointTestPageResult + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserEndpointTestPageResult from a JSON string +real_user_endpoint_test_page_result_instance = RealUserEndpointTestPageResult.from_json(json) +# print the JSON string representation of the object +print(RealUserEndpointTestPageResult.to_json()) + +# convert the object into a dict +real_user_endpoint_test_page_result_dict = real_user_endpoint_test_page_result_instance.to_dict() +# create an instance of RealUserEndpointTestPageResult from a dict +real_user_endpoint_test_page_result_from_dict = RealUserEndpointTestPageResult.from_dict(real_user_endpoint_test_page_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageResults.md b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageResults.md new file mode 100644 index 000000000..ffa0e10fa --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageResults.md @@ -0,0 +1,32 @@ +# RealUserEndpointTestPageResults + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[RealUserEndpointTestPageResult]**](RealUserEndpointTestPageResult.md) | | [optional] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**links** | [**PaginationNextLink**](PaginationNextLink.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_results import RealUserEndpointTestPageResults + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserEndpointTestPageResults from a JSON string +real_user_endpoint_test_page_results_instance = RealUserEndpointTestPageResults.from_json(json) +# print the JSON string representation of the object +print(RealUserEndpointTestPageResults.to_json()) + +# convert the object into a dict +real_user_endpoint_test_page_results_dict = real_user_endpoint_test_page_results_instance.to_dict() +# create an instance of RealUserEndpointTestPageResults from a dict +real_user_endpoint_test_page_results_from_dict = RealUserEndpointTestPageResults.from_dict(real_user_endpoint_test_page_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageTimings.md b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageTimings.md new file mode 100644 index 000000000..f70b42741 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestPageTimings.md @@ -0,0 +1,30 @@ +# RealUserEndpointTestPageTimings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**on_content_load** | **int** | DOM load time in milliseconds. | [optional] [readonly] +**on_load** | **int** | Page load time in milliseconds. | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_timings import RealUserEndpointTestPageTimings + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserEndpointTestPageTimings from a JSON string +real_user_endpoint_test_page_timings_instance = RealUserEndpointTestPageTimings.from_json(json) +# print the JSON string representation of the object +print(RealUserEndpointTestPageTimings.to_json()) + +# convert the object into a dict +real_user_endpoint_test_page_timings_dict = real_user_endpoint_test_page_timings_instance.to_dict() +# create an instance of RealUserEndpointTestPageTimings from a dict +real_user_endpoint_test_page_timings_from_dict = RealUserEndpointTestPageTimings.from_dict(real_user_endpoint_test_page_timings_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultRequestFilter.md b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultRequestFilter.md new file mode 100644 index 000000000..818ba29ac --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultRequestFilter.md @@ -0,0 +1,42 @@ +# RealUserEndpointTestResultRequestFilter + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**location** | **List[str]** | Location of the endpoint agent. | [optional] +**connection** | [**List[InterfaceHardwareType]**](InterfaceHardwareType.md) | | [optional] +**platform** | [**List[Platform]**](Platform.md) | | [optional] +**gateway** | **List[str]** | Endpoint agent default gateway IP address. | [optional] +**proxy_target** | **List[str]** | Endpoint agent proxy IP address. | [optional] +**vpn_target** | **List[str]** | Endpoint agent VPN endpoint IP address. | [optional] +**agent_id** | **List[str]** | Endpoint agent ID. | [optional] +**network_id** | **List[str]** | Network ID. | [optional] +**ssid** | **List[str]** | WiFi SSID. | [optional] +**bssid** | **List[str]** | WiFi BSSID. | [optional] +**destination_ip** | **List[str]** | Web site destination IP address. | [optional] +**domain** | **List[str]** | Web site base domain visited during the session. | [optional] +**trigger** | [**List[Trigger]**](Trigger.md) | Real user test trigger. | [optional] +**visited_site** | **List[str]** | Web site domain visited during the session. | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_result_request_filter import RealUserEndpointTestResultRequestFilter + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserEndpointTestResultRequestFilter from a JSON string +real_user_endpoint_test_result_request_filter_instance = RealUserEndpointTestResultRequestFilter.from_json(json) +# print the JSON string representation of the object +print(RealUserEndpointTestResultRequestFilter.to_json()) + +# convert the object into a dict +real_user_endpoint_test_result_request_filter_dict = real_user_endpoint_test_result_request_filter_instance.to_dict() +# create an instance of RealUserEndpointTestResultRequestFilter from a dict +real_user_endpoint_test_result_request_filter_from_dict = RealUserEndpointTestResultRequestFilter.from_dict(real_user_endpoint_test_result_request_filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResults.md b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResults.md new file mode 100644 index 000000000..e50cb6c40 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResults.md @@ -0,0 +1,32 @@ +# RealUserEndpointTestResults + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[RealUserEndpointTest]**](RealUserEndpointTest.md) | | [optional] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**links** | [**PaginationNextLink**](PaginationNextLink.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_results import RealUserEndpointTestResults + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserEndpointTestResults from a JSON string +real_user_endpoint_test_results_instance = RealUserEndpointTestResults.from_json(json) +# print the JSON string representation of the object +print(RealUserEndpointTestResults.to_json()) + +# convert the object into a dict +real_user_endpoint_test_results_dict = real_user_endpoint_test_results_instance.to_dict() +# create an instance of RealUserEndpointTestResults from a dict +real_user_endpoint_test_results_from_dict = RealUserEndpointTestResults.from_dict(real_user_endpoint_test_results_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultsApi.md b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultsApi.md new file mode 100644 index 000000000..1506e4490 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultsApi.md @@ -0,0 +1,475 @@ +# thousandeyes_sdk.endpoint_test_results.RealUserEndpointTestResultsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**filter_real_user_tests_network_results**](RealUserEndpointTestResultsApi.md#filter_real_user_tests_network_results) | **POST** /endpoint/test-results/real-user-tests/networks/filter | List endpoint real user tests +[**filter_real_user_tests_results**](RealUserEndpointTestResultsApi.md#filter_real_user_tests_results) | **POST** /endpoint/test-results/real-user-tests/filter | List endpoint real user tests +[**filter_real_user_tests_visited_pages_results**](RealUserEndpointTestResultsApi.md#filter_real_user_tests_visited_pages_results) | **POST** /endpoint/test-results/real-user-tests/pages/filter | List endpoint real user tests visited pages +[**get_real_user_test_page_results**](RealUserEndpointTestResultsApi.md#get_real_user_test_page_results) | **GET** /endpoint/test-results/real-user-tests/{id}/pages/{pageId} | Retrieve endpoint real user test page +[**get_real_user_test_results**](RealUserEndpointTestResultsApi.md#get_real_user_test_results) | **GET** /endpoint/test-results/real-user-tests/{id} | Retrieve endpoint real user test + + +# **filter_real_user_tests_network_results** +> RealUserEndpointTestNetworkResults filter_real_user_tests_network_results(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, real_user_endpoint_test_results_request=real_user_endpoint_test_results_request) + +List endpoint real user tests + +Returns a list of all endpoint real user tests. Sessions from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` Returns a `results` array of endpoint real user tests. Network sessions shown are from the latest round, or based on the time range specified. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_test_results +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_network_results import RealUserEndpointTestNetworkResults +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_results_request import RealUserEndpointTestResultsRequest +from thousandeyes_sdk.endpoint_test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_test_results.RealUserEndpointTestResultsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.RealUserEndpointTestResultsRequest() # RealUserEndpointTestResultsRequest | (optional) + + try: + # List endpoint real user tests + api_response = api_instance.filter_real_user_tests_network_results(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, real_user_endpoint_test_results_request=real_user_endpoint_test_results_request) + print("The response of RealUserEndpointTestResultsApi->filter_real_user_tests_network_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RealUserEndpointTestResultsApi->filter_real_user_tests_network_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + **real_user_endpoint_test_results_request** | [**RealUserEndpointTestResultsRequest**](RealUserEndpointTestResultsRequest.md)| | [optional] + +### Return type + +[**RealUserEndpointTestNetworkResults**](RealUserEndpointTestNetworkResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **filter_real_user_tests_results** +> RealUserEndpointTestResults filter_real_user_tests_results(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, real_user_endpoint_test_results_request=real_user_endpoint_test_results_request) + +List endpoint real user tests + +Returns a list of all endpoint real user tests. Results from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] } }' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] } }' ``` Returns a `results` array of endpoint real user tests. Either the latest results, or based on the time range and body filters specified. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_test_results +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_results import RealUserEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_results_request import RealUserEndpointTestResultsRequest +from thousandeyes_sdk.endpoint_test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_test_results.RealUserEndpointTestResultsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.RealUserEndpointTestResultsRequest() # RealUserEndpointTestResultsRequest | (optional) + + try: + # List endpoint real user tests + api_response = api_instance.filter_real_user_tests_results(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, real_user_endpoint_test_results_request=real_user_endpoint_test_results_request) + print("The response of RealUserEndpointTestResultsApi->filter_real_user_tests_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RealUserEndpointTestResultsApi->filter_real_user_tests_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + **real_user_endpoint_test_results_request** | [**RealUserEndpointTestResultsRequest**](RealUserEndpointTestResultsRequest.md)| | [optional] + +### Return type + +[**RealUserEndpointTestResults**](RealUserEndpointTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **filter_real_user_tests_visited_pages_results** +> RealUserEndpointTestPageResults filter_real_user_tests_visited_pages_results(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, real_user_endpoint_test_result_request_filter=real_user_endpoint_test_result_request_filter) + +List endpoint real user tests visited pages + +Returns a list of all endpoint real user tests visited pages. Sessions from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` Returns a `results` array of user loaded pages in an endpoint real user test. Pages shown are from the latest round, or based on the time range specified. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_test_results +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_results import RealUserEndpointTestPageResults +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_result_request_filter import RealUserEndpointTestResultRequestFilter +from thousandeyes_sdk.endpoint_test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_test_results.RealUserEndpointTestResultsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + real_user_endpoint_test_result_request_filter = thousandeyes_sdk.endpoint_test_results.RealUserEndpointTestResultRequestFilter() # RealUserEndpointTestResultRequestFilter | (optional) + + try: + # List endpoint real user tests visited pages + api_response = api_instance.filter_real_user_tests_visited_pages_results(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, real_user_endpoint_test_result_request_filter=real_user_endpoint_test_result_request_filter) + print("The response of RealUserEndpointTestResultsApi->filter_real_user_tests_visited_pages_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RealUserEndpointTestResultsApi->filter_real_user_tests_visited_pages_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + **real_user_endpoint_test_result_request_filter** | [**RealUserEndpointTestResultRequestFilter**](RealUserEndpointTestResultRequestFilter.md)| | [optional] + +### Return type + +[**RealUserEndpointTestPageResults**](RealUserEndpointTestPageResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_real_user_test_page_results** +> RealUserEndpointTestPageDetailResult get_real_user_test_page_results(id, page_id, aid=aid) + +Retrieve endpoint real user test page + +Returns details for endpoint real user test web page request. Provides complete waterfall information with all object requests. Sends back detailed endpoint real user test web page request. Returned object has a single field: `har` which is an HAR object according to the HTTP Archive 1.2 specifications. [You can read more about the specification](http://www.softwareishard.com/blog/har-12-spec/). In addition to standard fields, the object har includes a custom property `systemMetrics` which contain metrics about CPU and physical memory usage. Check `SystemMetrics` on schemas tab for more information. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_test_results +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_detail_result import RealUserEndpointTestPageDetailResult +from thousandeyes_sdk.endpoint_test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_test_results.RealUserEndpointTestResultsApi(api_client) + id = '07625:1490529480:h3qJQTpl' # str | The real user test id. + page_id = '281474976710706' # str | Web page ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Retrieve endpoint real user test page + api_response = api_instance.get_real_user_test_page_results(id, page_id, aid=aid) + print("The response of RealUserEndpointTestResultsApi->get_real_user_test_page_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RealUserEndpointTestResultsApi->get_real_user_test_page_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The real user test id. | + **page_id** | **str**| Web page ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**RealUserEndpointTestPageDetailResult**](RealUserEndpointTestPageDetailResult.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_real_user_test_results** +> RealUserEndpointTestDetailResults get_real_user_test_results(id, aid=aid) + +Retrieve endpoint real user test + +Provides details for an endpoint real user test. Returns a results array containing detailed information about endpoint real user tests.\" + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_test_results +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_detail_results import RealUserEndpointTestDetailResults +from thousandeyes_sdk.endpoint_test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_test_results.RealUserEndpointTestResultsApi(api_client) + id = '07625:1490529480:h3qJQTpl' # str | The real user test id. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Retrieve endpoint real user test + api_response = api_instance.get_real_user_test_results(id, aid=aid) + print("The response of RealUserEndpointTestResultsApi->get_real_user_test_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RealUserEndpointTestResultsApi->get_real_user_test_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The real user test id. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**RealUserEndpointTestDetailResults**](RealUserEndpointTestDetailResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultsRequest.md b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultsRequest.md new file mode 100644 index 000000000..d5f566bfd --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/docs/RealUserEndpointTestResultsRequest.md @@ -0,0 +1,29 @@ +# RealUserEndpointTestResultsRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**search_filters** | [**RealUserEndpointTestResultRequestFilter**](RealUserEndpointTestResultRequestFilter.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_results_request import RealUserEndpointTestResultsRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of RealUserEndpointTestResultsRequest from a JSON string +real_user_endpoint_test_results_request_instance = RealUserEndpointTestResultsRequest.from_json(json) +# print the JSON string representation of the object +print(RealUserEndpointTestResultsRequest.to_json()) + +# convert the object into a dict +real_user_endpoint_test_results_request_dict = real_user_endpoint_test_results_request_instance.to_dict() +# create an instance of RealUserEndpointTestResultsRequest from a dict +real_user_endpoint_test_results_request_from_dict = RealUserEndpointTestResultsRequest.from_dict(real_user_endpoint_test_results_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/__init__.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/__init__.py index 810127f9f..b1698df08 100644 --- a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/__init__.py +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/__init__.py @@ -14,29 +14,25 @@ # import apis into sdk package -from thousandeyes_sdk.endpoint_test_results.api.local_network_tests_results_api import LocalNetworkTestsResultsApi -from thousandeyes_sdk.endpoint_test_results.api.network_dynamic_tests_results_api import NetworkDynamicTestsResultsApi -from thousandeyes_sdk.endpoint_test_results.api.network_scheduled_tests_results_api import NetworkScheduledTestsResultsApi -from thousandeyes_sdk.endpoint_test_results.api.real_user_tests_results_api import RealUserTestsResultsApi -from thousandeyes_sdk.endpoint_test_results.api.web_http_server_scheduled_test_results_api import WebHTTPServerScheduledTestResultsApi +from thousandeyes_sdk.endpoint_test_results.api.http_server_endpoint_scheduled_test_results_api import HTTPServerEndpointScheduledTestResultsApi +from thousandeyes_sdk.endpoint_test_results.api.local_network_endpoint_test_results_api import LocalNetworkEndpointTestResultsApi +from thousandeyes_sdk.endpoint_test_results.api.network_dynamic_endpoint_test_results_api import NetworkDynamicEndpointTestResultsApi +from thousandeyes_sdk.endpoint_test_results.api.network_endpoint_scheduled_test_results_api import NetworkEndpointScheduledTestResultsApi +from thousandeyes_sdk.endpoint_test_results.api.real_user_endpoint_test_results_api import RealUserEndpointTestResultsApi # import models into sdk package -from thousandeyes_sdk.endpoint_test_results.models.alert_direction import AlertDirection -from thousandeyes_sdk.endpoint_test_results.models.alert_rounds_violation_mode import AlertRoundsViolationMode -from thousandeyes_sdk.endpoint_test_results.models.alert_rule import AlertRule -from thousandeyes_sdk.endpoint_test_results.models.alert_type import AlertType from thousandeyes_sdk.endpoint_test_results.models.application_score_quality import ApplicationScoreQuality from thousandeyes_sdk.endpoint_test_results.models.asn_details import AsnDetails from thousandeyes_sdk.endpoint_test_results.models.conditional_operator import ConditionalOperator from thousandeyes_sdk.endpoint_test_results.models.cpu_utilization import CpuUtilization -from thousandeyes_sdk.endpoint_test_results.models.dynamic_base_test_result import DynamicBaseTestResult +from thousandeyes_sdk.endpoint_test_results.models.dynamic_base_endpoint_test_result import DynamicBaseEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.dynamic_endpoint_test_webex import DynamicEndpointTestWebex +from thousandeyes_sdk.endpoint_test_results.models.dynamic_endpoint_tests_data_round_search import DynamicEndpointTestsDataRoundSearch +from thousandeyes_sdk.endpoint_test_results.models.dynamic_endpoint_tests_data_search_filter import DynamicEndpointTestsDataSearchFilter from thousandeyes_sdk.endpoint_test_results.models.dynamic_test import DynamicTest from thousandeyes_sdk.endpoint_test_results.models.dynamic_test_links import DynamicTestLinks from thousandeyes_sdk.endpoint_test_results.models.dynamic_test_self_link import DynamicTestSelfLink -from thousandeyes_sdk.endpoint_test_results.models.dynamic_test_webex import DynamicTestWebex -from thousandeyes_sdk.endpoint_test_results.models.dynamic_tests_data_round_search import DynamicTestsDataRoundSearch -from thousandeyes_sdk.endpoint_test_results.models.dynamic_tests_data_search_filter import DynamicTestsDataSearchFilter from thousandeyes_sdk.endpoint_test_results.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig from thousandeyes_sdk.endpoint_test_results.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig from thousandeyes_sdk.endpoint_test_results.models.endpoint_agent_to_server_test import EndpointAgentToServerTest @@ -47,40 +43,43 @@ from thousandeyes_sdk.endpoint_test_results.models.endpoint_http_server_test import EndpointHttpServerTest from thousandeyes_sdk.endpoint_test_results.models.endpoint_network_topology_result_request import EndpointNetworkTopologyResultRequest from thousandeyes_sdk.endpoint_test_results.models.endpoint_network_topology_result_request_filter import EndpointNetworkTopologyResultRequestFilter +from thousandeyes_sdk.endpoint_test_results.models.endpoint_path_trace import EndpointPathTrace +from thousandeyes_sdk.endpoint_test_results.models.endpoint_path_vis_hop import EndpointPathVisHop +from thousandeyes_sdk.endpoint_test_results.models.endpoint_path_vis_route import EndpointPathVisRoute from thousandeyes_sdk.endpoint_test_results.models.endpoint_ping_data_point_score import EndpointPingDataPointScore -from thousandeyes_sdk.endpoint_test_results.models.endpoint_real_user_test import EndpointRealUserTest -from thousandeyes_sdk.endpoint_test_results.models.endpoint_real_user_test_base import EndpointRealUserTestBase -from thousandeyes_sdk.endpoint_test_results.models.endpoint_real_user_test_detail import EndpointRealUserTestDetail -from thousandeyes_sdk.endpoint_test_results.models.endpoint_real_user_test_detail_results import EndpointRealUserTestDetailResults -from thousandeyes_sdk.endpoint_test_results.models.endpoint_real_user_test_result_request_filter import EndpointRealUserTestResultRequestFilter -from thousandeyes_sdk.endpoint_test_results.models.endpoint_real_user_test_results import EndpointRealUserTestResults -from thousandeyes_sdk.endpoint_test_results.models.endpoint_real_user_test_results_request import EndpointRealUserTestResultsRequest from thousandeyes_sdk.endpoint_test_results.models.endpoint_result_request_filter import EndpointResultRequestFilter from thousandeyes_sdk.endpoint_test_results.models.endpoint_scheduled_test import EndpointScheduledTest from thousandeyes_sdk.endpoint_test_results.models.endpoint_scheduled_test_type import EndpointScheduledTestType from thousandeyes_sdk.endpoint_test_results.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig from thousandeyes_sdk.endpoint_test_results.models.endpoint_test import EndpointTest from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_auth_type import EndpointTestAuthType +from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_ethernet_profile import EndpointTestEthernetProfile from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_links import EndpointTestLinks from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_protocol import EndpointTestProtocol +from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_result import EndpointTestResult from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_result_protocol import EndpointTestResultProtocol from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_self_link import EndpointTestSelfLink +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_rounds_search import EndpointTestsDataRoundsSearch +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_search_filter import EndpointTestsDataSearchFilter +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_search_sort import EndpointTestsDataSearchSort +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_search_sort_key import EndpointTestsDataSearchSortKey +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_threshold_filter import EndpointTestsDataThresholdFilter +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_threshold_filters import EndpointTestsDataThresholdFilters from thousandeyes_sdk.endpoint_test_results.models.error import Error -from thousandeyes_sdk.endpoint_test_results.models.ethernet_profile import EthernetProfile -from thousandeyes_sdk.endpoint_test_results.models.expand import Expand +from thousandeyes_sdk.endpoint_test_results.models.expand_endpoint_http_server_options import ExpandEndpointHttpServerOptions from thousandeyes_sdk.endpoint_test_results.models.gateway_network_ping import GatewayNetworkPing from thousandeyes_sdk.endpoint_test_results.models.hop import Hop +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_test_result import HttpEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_test_result_headers import HttpEndpointTestResultHeaders +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_test_results import HttpEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_rounds_search import HttpEndpointTestsDataRoundsSearch +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_search_filter import HttpEndpointTestsDataSearchFilter +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_search_sort import HttpEndpointTestsDataSearchSort +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_search_sort_key import HttpEndpointTestsDataSearchSortKey +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_threshold_filter import HttpEndpointTestsDataThresholdFilter +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_threshold_filters import HttpEndpointTestsDataThresholdFilters from thousandeyes_sdk.endpoint_test_results.models.http_error_type import HttpErrorType -from thousandeyes_sdk.endpoint_test_results.models.http_multi_test_results import HttpMultiTestResults -from thousandeyes_sdk.endpoint_test_results.models.http_test_result import HttpTestResult -from thousandeyes_sdk.endpoint_test_results.models.http_test_result_headers import HttpTestResultHeaders -from thousandeyes_sdk.endpoint_test_results.models.http_test_results import HttpTestResults -from thousandeyes_sdk.endpoint_test_results.models.http_tests_data_rounds_search import HttpTestsDataRoundsSearch -from thousandeyes_sdk.endpoint_test_results.models.http_tests_data_search_filter import HttpTestsDataSearchFilter -from thousandeyes_sdk.endpoint_test_results.models.http_tests_data_search_sort import HttpTestsDataSearchSort -from thousandeyes_sdk.endpoint_test_results.models.http_tests_data_search_sort_key import HttpTestsDataSearchSortKey -from thousandeyes_sdk.endpoint_test_results.models.http_tests_data_threshold_filter import HttpTestsDataThresholdFilter -from thousandeyes_sdk.endpoint_test_results.models.http_tests_data_threshold_filters import HttpTestsDataThresholdFilters +from thousandeyes_sdk.endpoint_test_results.models.http_multi_endpoint_test_results import HttpMultiEndpointTestResults from thousandeyes_sdk.endpoint_test_results.models.http_threshold_filter_name import HttpThresholdFilterName from thousandeyes_sdk.endpoint_test_results.models.interface_hardware_type import InterfaceHardwareType from thousandeyes_sdk.endpoint_test_results.models.link import Link @@ -90,49 +89,51 @@ from thousandeyes_sdk.endpoint_test_results.models.local_network_topology_result import LocalNetworkTopologyResult from thousandeyes_sdk.endpoint_test_results.models.local_network_topology_result_base import LocalNetworkTopologyResultBase from thousandeyes_sdk.endpoint_test_results.models.local_network_topology_results import LocalNetworkTopologyResults -from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_network_test_results import MultiTestIdNetworkTestResults -from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_tests_data_rounds_search import MultiTestIdTestsDataRoundsSearch -from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_tests_data_search_filter import MultiTestIdTestsDataSearchFilter -from thousandeyes_sdk.endpoint_test_results.models.network_dynamic_test_result import NetworkDynamicTestResult -from thousandeyes_sdk.endpoint_test_results.models.network_dynamic_test_results import NetworkDynamicTestResults +from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_endpoint_tests_data_rounds_search import MultiTestIdEndpointTestsDataRoundsSearch +from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_endpoint_tests_data_search_filter import MultiTestIdEndpointTestsDataSearchFilter +from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_network_endpoint_test_results import MultiTestIdNetworkEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.network_dynamic_endpoint_test_result import NetworkDynamicEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.network_dynamic_endpoint_test_results import NetworkDynamicEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.network_endpoint_test_result import NetworkEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.network_endpoint_test_results import NetworkEndpointTestResults from thousandeyes_sdk.endpoint_test_results.models.network_interface import NetworkInterface from thousandeyes_sdk.endpoint_test_results.models.network_metrics import NetworkMetrics from thousandeyes_sdk.endpoint_test_results.models.network_ping import NetworkPing from thousandeyes_sdk.endpoint_test_results.models.network_profile import NetworkProfile from thousandeyes_sdk.endpoint_test_results.models.network_proxy import NetworkProxy from thousandeyes_sdk.endpoint_test_results.models.network_proxy_profile import NetworkProxyProfile -from thousandeyes_sdk.endpoint_test_results.models.network_test_result import NetworkTestResult -from thousandeyes_sdk.endpoint_test_results.models.network_test_results import NetworkTestResults from thousandeyes_sdk.endpoint_test_results.models.network_topology_type import NetworkTopologyType from thousandeyes_sdk.endpoint_test_results.models.network_wireless_profile import NetworkWirelessProfile from thousandeyes_sdk.endpoint_test_results.models.pagination_next_and_self_link import PaginationNextAndSelfLink from thousandeyes_sdk.endpoint_test_results.models.pagination_next_link import PaginationNextLink -from thousandeyes_sdk.endpoint_test_results.models.path_vis_base_test_result import PathVisBaseTestResult -from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_dynamic_test_result import PathVisDetailDynamicTestResult -from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_dynamic_test_results import PathVisDetailDynamicTestResults -from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_test_result import PathVisDetailTestResult -from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_test_results import PathVisDetailTestResults -from thousandeyes_sdk.endpoint_test_results.models.path_vis_dynamic_test_result import PathVisDynamicTestResult -from thousandeyes_sdk.endpoint_test_results.models.path_vis_dynamic_test_results import PathVisDynamicTestResults -from thousandeyes_sdk.endpoint_test_results.models.path_vis_endpoint import PathVisEndpoint -from thousandeyes_sdk.endpoint_test_results.models.path_vis_hop import PathVisHop -from thousandeyes_sdk.endpoint_test_results.models.path_vis_route import PathVisRoute -from thousandeyes_sdk.endpoint_test_results.models.path_vis_test_result import PathVisTestResult -from thousandeyes_sdk.endpoint_test_results.models.path_vis_test_results import PathVisTestResults +from thousandeyes_sdk.endpoint_test_results.models.path_vis_base_endpoint_test_result import PathVisBaseEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_dynamic_endpoint_test_result import PathVisDetailDynamicEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_dynamic_endpoint_test_results import PathVisDetailDynamicEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_endpoint_test_result import PathVisDetailEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_endpoint_test_results import PathVisDetailEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.path_vis_dynamic_endpoint_test_result import PathVisDynamicEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.path_vis_dynamic_endpoint_test_results import PathVisDynamicEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.path_vis_endpoint_test_result import PathVisEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.path_vis_endpoint_test_results import PathVisEndpointTestResults from thousandeyes_sdk.endpoint_test_results.models.physical_memory_used_bytes import PhysicalMemoryUsedBytes from thousandeyes_sdk.endpoint_test_results.models.platform import Platform -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_coordinates import RealUserTestCoordinates -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_network import RealUserTestNetwork -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_network_result import RealUserTestNetworkResult -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_network_results import RealUserTestNetworkResults -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_page import RealUserTestPage -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_page_detail_result import RealUserTestPageDetailResult -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_page_result import RealUserTestPageResult -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_page_results import RealUserTestPageResults -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_page_timings import RealUserTestPageTimings +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test import RealUserEndpointTest +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_base import RealUserEndpointTestBase +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_coordinates import RealUserEndpointTestCoordinates +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_detail import RealUserEndpointTestDetail +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_detail_results import RealUserEndpointTestDetailResults +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_network import RealUserEndpointTestNetwork +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_network_result import RealUserEndpointTestNetworkResult +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_network_results import RealUserEndpointTestNetworkResults +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page import RealUserEndpointTestPage +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_detail_result import RealUserEndpointTestPageDetailResult +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_result import RealUserEndpointTestPageResult +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_results import RealUserEndpointTestPageResults +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_timings import RealUserEndpointTestPageTimings +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_result_request_filter import RealUserEndpointTestResultRequestFilter +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_results import RealUserEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_results_request import RealUserEndpointTestResultsRequest from thousandeyes_sdk.endpoint_test_results.models.self_links import SelfLinks -from thousandeyes_sdk.endpoint_test_results.models.sensitivity_level import SensitivityLevel -from thousandeyes_sdk.endpoint_test_results.models.severity import Severity from thousandeyes_sdk.endpoint_test_results.models.sort_order import SortOrder from thousandeyes_sdk.endpoint_test_results.models.system_metrics import SystemMetrics from thousandeyes_sdk.endpoint_test_results.models.target_network_ping import TargetNetworkPing @@ -144,14 +145,7 @@ from thousandeyes_sdk.endpoint_test_results.models.test_label import TestLabel from thousandeyes_sdk.endpoint_test_results.models.test_probe_mode_response import TestProbeModeResponse from thousandeyes_sdk.endpoint_test_results.models.test_protocol import TestProtocol -from thousandeyes_sdk.endpoint_test_results.models.test_result import TestResult from thousandeyes_sdk.endpoint_test_results.models.test_ssl_version_id import TestSslVersionId -from thousandeyes_sdk.endpoint_test_results.models.tests_data_rounds_search import TestsDataRoundsSearch -from thousandeyes_sdk.endpoint_test_results.models.tests_data_search_filter import TestsDataSearchFilter -from thousandeyes_sdk.endpoint_test_results.models.tests_data_search_sort import TestsDataSearchSort -from thousandeyes_sdk.endpoint_test_results.models.tests_data_search_sort_key import TestsDataSearchSortKey -from thousandeyes_sdk.endpoint_test_results.models.tests_data_threshold_filter import TestsDataThresholdFilter -from thousandeyes_sdk.endpoint_test_results.models.tests_data_threshold_filters import TestsDataThresholdFilters from thousandeyes_sdk.endpoint_test_results.models.threshold_filter_name import ThresholdFilterName from thousandeyes_sdk.endpoint_test_results.models.threshold_filter_operator import ThresholdFilterOperator from thousandeyes_sdk.endpoint_test_results.models.traceroute import Traceroute diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/__init__.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/__init__.py index 6dc5bd8b4..f0569beb4 100644 --- a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/__init__.py +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/__init__.py @@ -1,9 +1,9 @@ # flake8: noqa # import apis into api package -from thousandeyes_sdk.endpoint_test_results.api.local_network_tests_results_api import LocalNetworkTestsResultsApi -from thousandeyes_sdk.endpoint_test_results.api.network_dynamic_tests_results_api import NetworkDynamicTestsResultsApi -from thousandeyes_sdk.endpoint_test_results.api.network_scheduled_tests_results_api import NetworkScheduledTestsResultsApi -from thousandeyes_sdk.endpoint_test_results.api.real_user_tests_results_api import RealUserTestsResultsApi -from thousandeyes_sdk.endpoint_test_results.api.web_http_server_scheduled_test_results_api import WebHTTPServerScheduledTestResultsApi +from thousandeyes_sdk.endpoint_test_results.api.http_server_endpoint_scheduled_test_results_api import HTTPServerEndpointScheduledTestResultsApi +from thousandeyes_sdk.endpoint_test_results.api.local_network_endpoint_test_results_api import LocalNetworkEndpointTestResultsApi +from thousandeyes_sdk.endpoint_test_results.api.network_dynamic_endpoint_test_results_api import NetworkDynamicEndpointTestResultsApi +from thousandeyes_sdk.endpoint_test_results.api.network_endpoint_scheduled_test_results_api import NetworkEndpointScheduledTestResultsApi +from thousandeyes_sdk.endpoint_test_results.api.real_user_endpoint_test_results_api import RealUserEndpointTestResultsApi diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/http_server_endpoint_scheduled_test_results_api.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/http_server_endpoint_scheduled_test_results_api.py new file mode 100644 index 000000000..577efb801 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/http_server_endpoint_scheduled_test_results_api.py @@ -0,0 +1,864 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.endpoint_test_results.models + +from datetime import datetime +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.endpoint_test_results.models.expand_endpoint_http_server_options import ExpandEndpointHttpServerOptions +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_test_results import HttpEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_rounds_search import HttpEndpointTestsDataRoundsSearch +from thousandeyes_sdk.endpoint_test_results.models.http_multi_endpoint_test_results import HttpMultiEndpointTestResults + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class HTTPServerEndpointScheduledTestResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-endpoint-test-results")) + self.api_client = api_client + + + @validate_call + def get_http_server_scheduled_test_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[ExpandEndpointHttpServerOptions]], Field(description="This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HttpEndpointTestResults: + """Retrieve HTTP server scheduled test results + + Returns component-level (DNS, Connect, Wait and Receive) timing for the load of an object over HTTP. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query. + :type expand: List[ExpandEndpointHttpServerOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_http_server_scheduled_test_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ).data + + + @validate_call + def get_http_server_scheduled_test_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[ExpandEndpointHttpServerOptions]], Field(description="This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HttpEndpointTestResults]: + """Retrieve HTTP server scheduled test results + + Returns component-level (DNS, Connect, Wait and Receive) timing for the load of an object over HTTP. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query. + :type expand: List[ExpandEndpointHttpServerOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_http_server_scheduled_test_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ) + + + @validate_call + def get_http_server_scheduled_test_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[ExpandEndpointHttpServerOptions]], Field(description="This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve HTTP server scheduled test results + + Returns component-level (DNS, Connect, Wait and Receive) timing for the load of an object over HTTP. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query. + :type expand: List[ExpandEndpointHttpServerOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_http_server_scheduled_test_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_http_server_scheduled_test_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/test-results/scheduled-tests/{testId}/http-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_multi_test_filtered_http_server_scheduled_test_results( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[ExpandEndpointHttpServerOptions]], Field(description="This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query.")] = None, + http_endpoint_tests_data_rounds_search: Annotated[Optional[HttpEndpointTestsDataRoundsSearch], Field(description="Test data search filters.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HttpMultiEndpointTestResults: + """Filter HTTP server scheduled test results + + Returns component-level (DNS, Connect, Wait and Receive) timing for the load of an object over HTTP. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query. + :type expand: List[ExpandEndpointHttpServerOptions] + :param http_endpoint_tests_data_rounds_search: Test data search filters. + :type http_endpoint_tests_data_rounds_search: HttpEndpointTestsDataRoundsSearch + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_multi_test_filtered_http_server_scheduled_test_results_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + expand=expand, + http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpMultiEndpointTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ).data + + + @validate_call + def get_multi_test_filtered_http_server_scheduled_test_results_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[ExpandEndpointHttpServerOptions]], Field(description="This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query.")] = None, + http_endpoint_tests_data_rounds_search: Annotated[Optional[HttpEndpointTestsDataRoundsSearch], Field(description="Test data search filters.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HttpMultiEndpointTestResults]: + """Filter HTTP server scheduled test results + + Returns component-level (DNS, Connect, Wait and Receive) timing for the load of an object over HTTP. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query. + :type expand: List[ExpandEndpointHttpServerOptions] + :param http_endpoint_tests_data_rounds_search: Test data search filters. + :type http_endpoint_tests_data_rounds_search: HttpEndpointTestsDataRoundsSearch + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_multi_test_filtered_http_server_scheduled_test_results_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + expand=expand, + http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpMultiEndpointTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ) + + + @validate_call + def get_multi_test_filtered_http_server_scheduled_test_results_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[ExpandEndpointHttpServerOptions]], Field(description="This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query.")] = None, + http_endpoint_tests_data_rounds_search: Annotated[Optional[HttpEndpointTestsDataRoundsSearch], Field(description="Test data search filters.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Filter HTTP server scheduled test results + + Returns component-level (DNS, Connect, Wait and Receive) timing for the load of an object over HTTP. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter is optional and determines whether to expand resources related to test results. By default, no expansion occurs when this query parameter is omitted. To expand a specific resource, such as \"header,\" append `?expand=header` to the query. + :type expand: List[ExpandEndpointHttpServerOptions] + :param http_endpoint_tests_data_rounds_search: Test data search filters. + :type http_endpoint_tests_data_rounds_search: HttpEndpointTestsDataRoundsSearch + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_multi_test_filtered_http_server_scheduled_test_results_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + expand=expand, + http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpMultiEndpointTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_multi_test_filtered_http_server_scheduled_test_results_serialize( + self, + aid, + window, + start_date, + end_date, + cursor, + expand, + http_endpoint_tests_data_rounds_search, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if http_endpoint_tests_data_rounds_search is not None: + _body_params = http_endpoint_tests_data_rounds_search + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/test-results/scheduled-tests/http-server/filter', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/local_network_endpoint_test_results_api.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/local_network_endpoint_test_results_api.py new file mode 100644 index 000000000..ba070e7a8 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/local_network_endpoint_test_results_api.py @@ -0,0 +1,1024 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.endpoint_test_results.models + +from datetime import datetime +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.endpoint_test_results.models.endpoint_network_topology_result_request import EndpointNetworkTopologyResultRequest +from thousandeyes_sdk.endpoint_test_results.models.local_network_results import LocalNetworkResults +from thousandeyes_sdk.endpoint_test_results.models.local_network_topology_detail_results import LocalNetworkTopologyDetailResults +from thousandeyes_sdk.endpoint_test_results.models.local_network_topology_results import LocalNetworkTopologyResults + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class LocalNetworkEndpointTestResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-endpoint-test-results")) + self.api_client = api_client + + + @validate_call + def filter_local_networks_test_results_topologies( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + endpoint_network_topology_result_request: Optional[EndpointNetworkTopologyResultRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LocalNetworkTopologyResults: + """List endpoint network topologies probes + + Returns a list of all endpoint local network topologies probes. Results from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter?window=12h' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Warning Note that a maximum of 12h worth of data can be retrieved at once. If you need more, you need to make multiple requests. Returns a `results` array of network topology probes. Network topology probes shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param endpoint_network_topology_result_request: + :type endpoint_network_topology_result_request: EndpointNetworkTopologyResultRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_local_networks_test_results_topologies_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + endpoint_network_topology_result_request=endpoint_network_topology_result_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LocalNetworkTopologyResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ).data + + + @validate_call + def filter_local_networks_test_results_topologies_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + endpoint_network_topology_result_request: Optional[EndpointNetworkTopologyResultRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LocalNetworkTopologyResults]: + """List endpoint network topologies probes + + Returns a list of all endpoint local network topologies probes. Results from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter?window=12h' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Warning Note that a maximum of 12h worth of data can be retrieved at once. If you need more, you need to make multiple requests. Returns a `results` array of network topology probes. Network topology probes shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param endpoint_network_topology_result_request: + :type endpoint_network_topology_result_request: EndpointNetworkTopologyResultRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_local_networks_test_results_topologies_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + endpoint_network_topology_result_request=endpoint_network_topology_result_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LocalNetworkTopologyResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ) + + + @validate_call + def filter_local_networks_test_results_topologies_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + endpoint_network_topology_result_request: Optional[EndpointNetworkTopologyResultRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List endpoint network topologies probes + + Returns a list of all endpoint local network topologies probes. Results from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/local-networks/topologies/filter?window=12h' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Warning Note that a maximum of 12h worth of data can be retrieved at once. If you need more, you need to make multiple requests. Returns a `results` array of network topology probes. Network topology probes shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param endpoint_network_topology_result_request: + :type endpoint_network_topology_result_request: EndpointNetworkTopologyResultRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_local_networks_test_results_topologies_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + endpoint_network_topology_result_request=endpoint_network_topology_result_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LocalNetworkTopologyResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _filter_local_networks_test_results_topologies_serialize( + self, + aid, + window, + start_date, + end_date, + cursor, + endpoint_network_topology_result_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + if endpoint_network_topology_result_request is not None: + _body_params = endpoint_network_topology_result_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/test-results/local-networks/topologies/filter', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_local_networks_test_results( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LocalNetworkResults: + """List local networks + + Returns a list of all the networks used by endpoint agents. Sends back a `localNetworks` array. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_local_networks_test_results_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LocalNetworkResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ).data + + + @validate_call + def get_local_networks_test_results_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LocalNetworkResults]: + """List local networks + + Returns a list of all the networks used by endpoint agents. Sends back a `localNetworks` array. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_local_networks_test_results_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LocalNetworkResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ) + + + @validate_call + def get_local_networks_test_results_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List local networks + + Returns a list of all the networks used by endpoint agents. Sends back a `localNetworks` array. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_local_networks_test_results_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LocalNetworkResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_local_networks_test_results_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/test-results/local-networks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_local_networks_test_results_topology( + self, + network_topology_id: Annotated[StrictStr, Field(description="The network topology ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LocalNetworkTopologyDetailResults: + """Retrieve endpoint local network topology + + Returns detailed data of a local network topology. + + :param network_topology_id: The network topology ID. (required) + :type network_topology_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_local_networks_test_results_topology_serialize( + network_topology_id=network_topology_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LocalNetworkTopologyDetailResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ).data + + + @validate_call + def get_local_networks_test_results_topology_with_http_info( + self, + network_topology_id: Annotated[StrictStr, Field(description="The network topology ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LocalNetworkTopologyDetailResults]: + """Retrieve endpoint local network topology + + Returns detailed data of a local network topology. + + :param network_topology_id: The network topology ID. (required) + :type network_topology_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_local_networks_test_results_topology_serialize( + network_topology_id=network_topology_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LocalNetworkTopologyDetailResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ) + + + @validate_call + def get_local_networks_test_results_topology_without_preload_content( + self, + network_topology_id: Annotated[StrictStr, Field(description="The network topology ID.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve endpoint local network topology + + Returns detailed data of a local network topology. + + :param network_topology_id: The network topology ID. (required) + :type network_topology_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_local_networks_test_results_topology_serialize( + network_topology_id=network_topology_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LocalNetworkTopologyDetailResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_local_networks_test_results_topology_serialize( + self, + network_topology_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if network_topology_id is not None: + _path_params['networkTopologyId'] = network_topology_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/test-results/local-networks/topologies/{networkTopologyId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/network_dynamic_endpoint_test_results_api.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/network_dynamic_endpoint_test_results_api.py new file mode 100644 index 000000000..eccf6793b --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/network_dynamic_endpoint_test_results_api.py @@ -0,0 +1,1170 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.endpoint_test_results.models + +from datetime import datetime +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.endpoint_test_results.models.dynamic_endpoint_tests_data_round_search import DynamicEndpointTestsDataRoundSearch +from thousandeyes_sdk.endpoint_test_results.models.network_dynamic_endpoint_test_results import NetworkDynamicEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_dynamic_endpoint_test_results import PathVisDetailDynamicEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.path_vis_dynamic_endpoint_test_results import PathVisDynamicEndpointTestResults + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class NetworkDynamicEndpointTestResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-endpoint-test-results")) + self.api_client = api_client + + + @validate_call + def filter_dynamic_test_network_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + dynamic_endpoint_tests_data_round_search: Annotated[Optional[DynamicEndpointTestsDataRoundSearch], Field(description="Tests data search filters.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NetworkDynamicEndpointTestResults: + """Retrieve network dynamic test results + + Returns network metrics (`loss`, `latency`, `jitter` and `bandwidth`) from each endpoint agent, for each `roundId` in the requested window. When Time Frame is provided the rounds specific to the time frame is returned and the order is not pre-defined unless a user specifies the sort order in filter. When no time frame is provided the latest rounds are returned. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param dynamic_endpoint_tests_data_round_search: Tests data search filters. + :type dynamic_endpoint_tests_data_round_search: DynamicEndpointTestsDataRoundSearch + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_dynamic_test_network_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + dynamic_endpoint_tests_data_round_search=dynamic_endpoint_tests_data_round_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NetworkDynamicEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ).data + + + @validate_call + def filter_dynamic_test_network_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + dynamic_endpoint_tests_data_round_search: Annotated[Optional[DynamicEndpointTestsDataRoundSearch], Field(description="Tests data search filters.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NetworkDynamicEndpointTestResults]: + """Retrieve network dynamic test results + + Returns network metrics (`loss`, `latency`, `jitter` and `bandwidth`) from each endpoint agent, for each `roundId` in the requested window. When Time Frame is provided the rounds specific to the time frame is returned and the order is not pre-defined unless a user specifies the sort order in filter. When no time frame is provided the latest rounds are returned. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param dynamic_endpoint_tests_data_round_search: Tests data search filters. + :type dynamic_endpoint_tests_data_round_search: DynamicEndpointTestsDataRoundSearch + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_dynamic_test_network_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + dynamic_endpoint_tests_data_round_search=dynamic_endpoint_tests_data_round_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NetworkDynamicEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ) + + + @validate_call + def filter_dynamic_test_network_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + dynamic_endpoint_tests_data_round_search: Annotated[Optional[DynamicEndpointTestsDataRoundSearch], Field(description="Tests data search filters.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve network dynamic test results + + Returns network metrics (`loss`, `latency`, `jitter` and `bandwidth`) from each endpoint agent, for each `roundId` in the requested window. When Time Frame is provided the rounds specific to the time frame is returned and the order is not pre-defined unless a user specifies the sort order in filter. When no time frame is provided the latest rounds are returned. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param dynamic_endpoint_tests_data_round_search: Tests data search filters. + :type dynamic_endpoint_tests_data_round_search: DynamicEndpointTestsDataRoundSearch + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_dynamic_test_network_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + dynamic_endpoint_tests_data_round_search=dynamic_endpoint_tests_data_round_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NetworkDynamicEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _filter_dynamic_test_network_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + dynamic_endpoint_tests_data_round_search, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + if dynamic_endpoint_tests_data_round_search is not None: + _body_params = dynamic_endpoint_tests_data_round_search + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/test-results/dynamic-tests/{testId}/network/filter', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_dynamic_test_path_vis_agent_round_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PathVisDetailDynamicEndpointTestResults: + """Retrieve path visualization network dynamic test results details + + Returns a hop-by-hop summary of the path trace data collected during path visualization. In each round, one path discovery attempt is made to reach the destination. The entire path is returned. A `roundId` must be specified. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dynamic_test_path_vis_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisDetailDynamicEndpointTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ).data + + + @validate_call + def get_dynamic_test_path_vis_agent_round_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PathVisDetailDynamicEndpointTestResults]: + """Retrieve path visualization network dynamic test results details + + Returns a hop-by-hop summary of the path trace data collected during path visualization. In each round, one path discovery attempt is made to reach the destination. The entire path is returned. A `roundId` must be specified. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dynamic_test_path_vis_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisDetailDynamicEndpointTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ) + + + @validate_call + def get_dynamic_test_path_vis_agent_round_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve path visualization network dynamic test results details + + Returns a hop-by-hop summary of the path trace data collected during path visualization. In each round, one path discovery attempt is made to reach the destination. The entire path is returned. A `roundId` must be specified. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dynamic_test_path_vis_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisDetailDynamicEndpointTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_dynamic_test_path_vis_agent_round_results_serialize( + self, + test_id, + agent_id, + round_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + if agent_id is not None: + _path_params['agentId'] = agent_id + if round_id is not None: + _path_params['roundId'] = round_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/test-results/dynamic-tests/{testId}/path-vis/agent/{agentId}/round/{roundId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_dynamic_test_path_vis_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PathVisDynamicEndpointTestResults: + """Retrieve path visualization network dynamic test results + + Returns a summary of the path visualization data collected from each endpoint agent to the destination. In each path visualization attempt, one attempt is made to reach the destination. Each set of data is summarized, based on response time, number of hops, and response time to the target. A time frame must be specified, or the most recent round within last 2 hours will be returned. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dynamic_test_path_vis_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisDynamicEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ).data + + + @validate_call + def get_dynamic_test_path_vis_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PathVisDynamicEndpointTestResults]: + """Retrieve path visualization network dynamic test results + + Returns a summary of the path visualization data collected from each endpoint agent to the destination. In each path visualization attempt, one attempt is made to reach the destination. Each set of data is summarized, based on response time, number of hops, and response time to the target. A time frame must be specified, or the most recent round within last 2 hours will be returned. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dynamic_test_path_vis_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisDynamicEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ) + + + @validate_call + def get_dynamic_test_path_vis_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve path visualization network dynamic test results + + Returns a summary of the path visualization data collected from each endpoint agent to the destination. In each path visualization attempt, one attempt is made to reach the destination. Each set of data is summarized, based on response time, number of hops, and response time to the target. A time frame must be specified, or the most recent round within last 2 hours will be returned. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dynamic_test_path_vis_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisDynamicEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_dynamic_test_path_vis_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/test-results/dynamic-tests/{testId}/path-vis', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/network_endpoint_scheduled_test_results_api.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/network_endpoint_scheduled_test_results_api.py new file mode 100644 index 000000000..e8288280a --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/network_endpoint_scheduled_test_results_api.py @@ -0,0 +1,1582 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.endpoint_test_results.models + +from datetime import datetime +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_rounds_search import EndpointTestsDataRoundsSearch +from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_endpoint_tests_data_rounds_search import MultiTestIdEndpointTestsDataRoundsSearch +from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_network_endpoint_test_results import MultiTestIdNetworkEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.network_endpoint_test_results import NetworkEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_endpoint_test_results import PathVisDetailEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.path_vis_endpoint_test_results import PathVisEndpointTestResults + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class NetworkEndpointScheduledTestResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-endpoint-test-results")) + self.api_client = api_client + + + @validate_call + def filter_scheduled_test_network_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + endpoint_tests_data_rounds_search: Annotated[Optional[EndpointTestsDataRoundsSearch], Field(description="Tests data search filters.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NetworkEndpointTestResults: + """Retrieve network scheduled test results + + Returns network metrics (loss, latency, and jitter) from each endpoint agent, for each roundId within the specified time window, as determined by search filters. If a time frame is provided, the rounds relevant to that time frame are returned, and the order is not predefined unless the user specifies a sort order in the filter. When no time frame is provided, the latest rounds are returned. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param endpoint_tests_data_rounds_search: Tests data search filters. + :type endpoint_tests_data_rounds_search: EndpointTestsDataRoundsSearch + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_scheduled_test_network_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + endpoint_tests_data_rounds_search=endpoint_tests_data_rounds_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NetworkEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ).data + + + @validate_call + def filter_scheduled_test_network_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + endpoint_tests_data_rounds_search: Annotated[Optional[EndpointTestsDataRoundsSearch], Field(description="Tests data search filters.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NetworkEndpointTestResults]: + """Retrieve network scheduled test results + + Returns network metrics (loss, latency, and jitter) from each endpoint agent, for each roundId within the specified time window, as determined by search filters. If a time frame is provided, the rounds relevant to that time frame are returned, and the order is not predefined unless the user specifies a sort order in the filter. When no time frame is provided, the latest rounds are returned. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param endpoint_tests_data_rounds_search: Tests data search filters. + :type endpoint_tests_data_rounds_search: EndpointTestsDataRoundsSearch + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_scheduled_test_network_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + endpoint_tests_data_rounds_search=endpoint_tests_data_rounds_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NetworkEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ) + + + @validate_call + def filter_scheduled_test_network_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + endpoint_tests_data_rounds_search: Annotated[Optional[EndpointTestsDataRoundsSearch], Field(description="Tests data search filters.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve network scheduled test results + + Returns network metrics (loss, latency, and jitter) from each endpoint agent, for each roundId within the specified time window, as determined by search filters. If a time frame is provided, the rounds relevant to that time frame are returned, and the order is not predefined unless the user specifies a sort order in the filter. When no time frame is provided, the latest rounds are returned. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param endpoint_tests_data_rounds_search: Tests data search filters. + :type endpoint_tests_data_rounds_search: EndpointTestsDataRoundsSearch + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_scheduled_test_network_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + endpoint_tests_data_rounds_search=endpoint_tests_data_rounds_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NetworkEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _filter_scheduled_test_network_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + endpoint_tests_data_rounds_search, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + if endpoint_tests_data_rounds_search is not None: + _body_params = endpoint_tests_data_rounds_search + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/test-results/scheduled-tests/{testId}/network/filter', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def filter_scheduled_tests_network_results( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + max: Annotated[Optional[StrictInt], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + multi_test_id_endpoint_tests_data_rounds_search: Annotated[Optional[MultiTestIdEndpointTestsDataRoundsSearch], Field(description="Test data search filters.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MultiTestIdNetworkEndpointTestResults: + """Retrieve network scheduled test results from multiple tests + + Returns network metrics, including loss, latency, and jitter, for multiple test IDs obtained from each endpoint agent. It allows you to specify a time window using search filters to retrieve metrics for specific round IDs within that time frame. The default order of results is unspecified unless you include a sorting preference in the filter. When no time frame is provided, the API returns metrics for the most recent rounds. Access to all accounts associated with the specified test IDs is required to use this endpoint. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param max: (Optional) Maximum number of objects to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param multi_test_id_endpoint_tests_data_rounds_search: Test data search filters. + :type multi_test_id_endpoint_tests_data_rounds_search: MultiTestIdEndpointTestsDataRoundsSearch + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_scheduled_tests_network_results_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + max=max, + cursor=cursor, + multi_test_id_endpoint_tests_data_rounds_search=multi_test_id_endpoint_tests_data_rounds_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MultiTestIdNetworkEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ).data + + + @validate_call + def filter_scheduled_tests_network_results_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + max: Annotated[Optional[StrictInt], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + multi_test_id_endpoint_tests_data_rounds_search: Annotated[Optional[MultiTestIdEndpointTestsDataRoundsSearch], Field(description="Test data search filters.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MultiTestIdNetworkEndpointTestResults]: + """Retrieve network scheduled test results from multiple tests + + Returns network metrics, including loss, latency, and jitter, for multiple test IDs obtained from each endpoint agent. It allows you to specify a time window using search filters to retrieve metrics for specific round IDs within that time frame. The default order of results is unspecified unless you include a sorting preference in the filter. When no time frame is provided, the API returns metrics for the most recent rounds. Access to all accounts associated with the specified test IDs is required to use this endpoint. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param max: (Optional) Maximum number of objects to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param multi_test_id_endpoint_tests_data_rounds_search: Test data search filters. + :type multi_test_id_endpoint_tests_data_rounds_search: MultiTestIdEndpointTestsDataRoundsSearch + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_scheduled_tests_network_results_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + max=max, + cursor=cursor, + multi_test_id_endpoint_tests_data_rounds_search=multi_test_id_endpoint_tests_data_rounds_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MultiTestIdNetworkEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ) + + + @validate_call + def filter_scheduled_tests_network_results_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + max: Annotated[Optional[StrictInt], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + multi_test_id_endpoint_tests_data_rounds_search: Annotated[Optional[MultiTestIdEndpointTestsDataRoundsSearch], Field(description="Test data search filters.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve network scheduled test results from multiple tests + + Returns network metrics, including loss, latency, and jitter, for multiple test IDs obtained from each endpoint agent. It allows you to specify a time window using search filters to retrieve metrics for specific round IDs within that time frame. The default order of results is unspecified unless you include a sorting preference in the filter. When no time frame is provided, the API returns metrics for the most recent rounds. Access to all accounts associated with the specified test IDs is required to use this endpoint. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param max: (Optional) Maximum number of objects to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param multi_test_id_endpoint_tests_data_rounds_search: Test data search filters. + :type multi_test_id_endpoint_tests_data_rounds_search: MultiTestIdEndpointTestsDataRoundsSearch + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_scheduled_tests_network_results_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + max=max, + cursor=cursor, + multi_test_id_endpoint_tests_data_rounds_search=multi_test_id_endpoint_tests_data_rounds_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MultiTestIdNetworkEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _filter_scheduled_tests_network_results_serialize( + self, + aid, + window, + start_date, + end_date, + max, + cursor, + multi_test_id_endpoint_tests_data_rounds_search, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if max is not None: + + _query_params.append(('max', max)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + if multi_test_id_endpoint_tests_data_rounds_search is not None: + _body_params = multi_test_id_endpoint_tests_data_rounds_search + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/test-results/scheduled-tests/network/filter', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_scheduled_test_path_vis_agent_round_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PathVisDetailEndpointTestResults: + """Retrieve path visualization network scheduled test results details + + Returns a hop-by-hop summary of the path trace data collected during path visualization. In each round, one path discovery attempt is made to reach the destination. The entire path is returned. A `roundId` must be specified. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_scheduled_test_path_vis_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisDetailEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ).data + + + @validate_call + def get_scheduled_test_path_vis_agent_round_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PathVisDetailEndpointTestResults]: + """Retrieve path visualization network scheduled test results details + + Returns a hop-by-hop summary of the path trace data collected during path visualization. In each round, one path discovery attempt is made to reach the destination. The entire path is returned. A `roundId` must be specified. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_scheduled_test_path_vis_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisDetailEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ) + + + @validate_call + def get_scheduled_test_path_vis_agent_round_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve path visualization network scheduled test results details + + Returns a hop-by-hop summary of the path trace data collected during path visualization. In each round, one path discovery attempt is made to reach the destination. The entire path is returned. A `roundId` must be specified. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_scheduled_test_path_vis_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisDetailEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_scheduled_test_path_vis_agent_round_results_serialize( + self, + test_id, + agent_id, + round_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + if agent_id is not None: + _path_params['agentId'] = agent_id + if round_id is not None: + _path_params['roundId'] = round_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/test-results/scheduled-tests/{testId}/path-vis/agent/{agentId}/round/{roundId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_scheduled_test_path_vis_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PathVisEndpointTestResults: + """Retrieve path visualization network scheduled test results + + Returns a summary of the path visualization data collected from each endpoint agent to the destination. In each path visualization attempt, one attempt is made to reach the destination. Each set of data is summarized, based on response time, number of hops, and response time to the target. A time frame must be specified, or the most recent round within last 2 hours is returned. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_scheduled_test_path_vis_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ).data + + + @validate_call + def get_scheduled_test_path_vis_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PathVisEndpointTestResults]: + """Retrieve path visualization network scheduled test results + + Returns a summary of the path visualization data collected from each endpoint agent to the destination. In each path visualization attempt, one attempt is made to reach the destination. Each set of data is summarized, based on response time, number of hops, and response time to the target. A time frame must be specified, or the most recent round within last 2 hours is returned. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_scheduled_test_path_vis_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ) + + + @validate_call + def get_scheduled_test_path_vis_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve path visualization network scheduled test results + + Returns a summary of the path visualization data collected from each endpoint agent to the destination. In each path visualization attempt, one attempt is made to reach the destination. Each set of data is summarized, based on response time, number of hops, and response time to the target. A time frame must be specified, or the most recent round within last 2 hours is returned. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_scheduled_test_path_vis_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisEndpointTestResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_scheduled_test_path_vis_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/test-results/scheduled-tests/{testId}/path-vis', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/real_user_endpoint_test_results_api.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/real_user_endpoint_test_results_api.py new file mode 100644 index 000000000..a51353c10 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/api/real_user_endpoint_test_results_api.py @@ -0,0 +1,1855 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.endpoint_test_results.models + +from datetime import datetime +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_detail_results import RealUserEndpointTestDetailResults +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_network_results import RealUserEndpointTestNetworkResults +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_detail_result import RealUserEndpointTestPageDetailResult +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_results import RealUserEndpointTestPageResults +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_result_request_filter import RealUserEndpointTestResultRequestFilter +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_results import RealUserEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_results_request import RealUserEndpointTestResultsRequest + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class RealUserEndpointTestResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-endpoint-test-results")) + self.api_client = api_client + + + @validate_call + def filter_real_user_tests_network_results( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + real_user_endpoint_test_results_request: Optional[RealUserEndpointTestResultsRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RealUserEndpointTestNetworkResults: + """List endpoint real user tests + + Returns a list of all endpoint real user tests. Sessions from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` Returns a `results` array of endpoint real user tests. Network sessions shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param real_user_endpoint_test_results_request: + :type real_user_endpoint_test_results_request: RealUserEndpointTestResultsRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_real_user_tests_network_results_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + real_user_endpoint_test_results_request=real_user_endpoint_test_results_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RealUserEndpointTestNetworkResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ).data + + + @validate_call + def filter_real_user_tests_network_results_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + real_user_endpoint_test_results_request: Optional[RealUserEndpointTestResultsRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RealUserEndpointTestNetworkResults]: + """List endpoint real user tests + + Returns a list of all endpoint real user tests. Sessions from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` Returns a `results` array of endpoint real user tests. Network sessions shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param real_user_endpoint_test_results_request: + :type real_user_endpoint_test_results_request: RealUserEndpointTestResultsRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_real_user_tests_network_results_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + real_user_endpoint_test_results_request=real_user_endpoint_test_results_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RealUserEndpointTestNetworkResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ) + + + @validate_call + def filter_real_user_tests_network_results_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + real_user_endpoint_test_results_request: Optional[RealUserEndpointTestResultsRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List endpoint real user tests + + Returns a list of all endpoint real user tests. Sessions from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/networks/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` Returns a `results` array of endpoint real user tests. Network sessions shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param real_user_endpoint_test_results_request: + :type real_user_endpoint_test_results_request: RealUserEndpointTestResultsRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_real_user_tests_network_results_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + real_user_endpoint_test_results_request=real_user_endpoint_test_results_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RealUserEndpointTestNetworkResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _filter_real_user_tests_network_results_serialize( + self, + aid, + window, + start_date, + end_date, + cursor, + real_user_endpoint_test_results_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + if real_user_endpoint_test_results_request is not None: + _body_params = real_user_endpoint_test_results_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/test-results/real-user-tests/networks/filter', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def filter_real_user_tests_results( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + real_user_endpoint_test_results_request: Optional[RealUserEndpointTestResultsRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RealUserEndpointTestResults: + """List endpoint real user tests + + Returns a list of all endpoint real user tests. Results from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] } }' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] } }' ``` Returns a `results` array of endpoint real user tests. Either the latest results, or based on the time range and body filters specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param real_user_endpoint_test_results_request: + :type real_user_endpoint_test_results_request: RealUserEndpointTestResultsRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_real_user_tests_results_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + real_user_endpoint_test_results_request=real_user_endpoint_test_results_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RealUserEndpointTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ).data + + + @validate_call + def filter_real_user_tests_results_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + real_user_endpoint_test_results_request: Optional[RealUserEndpointTestResultsRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RealUserEndpointTestResults]: + """List endpoint real user tests + + Returns a list of all endpoint real user tests. Results from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] } }' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] } }' ``` Returns a `results` array of endpoint real user tests. Either the latest results, or based on the time range and body filters specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param real_user_endpoint_test_results_request: + :type real_user_endpoint_test_results_request: RealUserEndpointTestResultsRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_real_user_tests_results_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + real_user_endpoint_test_results_request=real_user_endpoint_test_results_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RealUserEndpointTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ) + + + @validate_call + def filter_real_user_tests_results_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + real_user_endpoint_test_results_request: Optional[RealUserEndpointTestResultsRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List endpoint real user tests + + Returns a list of all endpoint real user tests. Results from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] } }' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] } }' ``` Returns a `results` array of endpoint real user tests. Either the latest results, or based on the time range and body filters specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param real_user_endpoint_test_results_request: + :type real_user_endpoint_test_results_request: RealUserEndpointTestResultsRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_real_user_tests_results_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + real_user_endpoint_test_results_request=real_user_endpoint_test_results_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RealUserEndpointTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _filter_real_user_tests_results_serialize( + self, + aid, + window, + start_date, + end_date, + cursor, + real_user_endpoint_test_results_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + if real_user_endpoint_test_results_request is not None: + _body_params = real_user_endpoint_test_results_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/test-results/real-user-tests/filter', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def filter_real_user_tests_visited_pages_results( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + real_user_endpoint_test_result_request_filter: Optional[RealUserEndpointTestResultRequestFilter] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RealUserEndpointTestPageResults: + """List endpoint real user tests visited pages + + Returns a list of all endpoint real user tests visited pages. Sessions from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` Returns a `results` array of user loaded pages in an endpoint real user test. Pages shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param real_user_endpoint_test_result_request_filter: + :type real_user_endpoint_test_result_request_filter: RealUserEndpointTestResultRequestFilter + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_real_user_tests_visited_pages_results_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + real_user_endpoint_test_result_request_filter=real_user_endpoint_test_result_request_filter, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RealUserEndpointTestPageResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ).data + + + @validate_call + def filter_real_user_tests_visited_pages_results_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + real_user_endpoint_test_result_request_filter: Optional[RealUserEndpointTestResultRequestFilter] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RealUserEndpointTestPageResults]: + """List endpoint real user tests visited pages + + Returns a list of all endpoint real user tests visited pages. Sessions from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` Returns a `results` array of user loaded pages in an endpoint real user test. Pages shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param real_user_endpoint_test_result_request_filter: + :type real_user_endpoint_test_result_request_filter: RealUserEndpointTestResultRequestFilter + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_real_user_tests_visited_pages_results_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + real_user_endpoint_test_result_request_filter=real_user_endpoint_test_result_request_filter, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RealUserEndpointTestPageResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ) + + + @validate_call + def filter_real_user_tests_visited_pages_results_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + real_user_endpoint_test_result_request_filter: Optional[RealUserEndpointTestResultRequestFilter] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List endpoint real user tests visited pages + + Returns a list of all endpoint real user tests visited pages. Sessions from the last round are provided unless an explicit start and end is provided with `startDate`, `endDate` or `window` optional parameters. ## Request body filters This endpoint supports complex filtering using the request body. It is important these filters remain unaltered when making use of pagination, otherwise the results will not be coherent with the original request. ### Multiple filter fields When multiple filter fields are provided, a logical `AND` is applied between the filters. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ] }}' ``` ### Filter field with multiple values When a filter field contains multiple values, a logical `OR` is applied between the filter values. ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` ### Combination of request parameters and body filters ``` curl --location --request POST 'https://api.thousandeyes.com/v7/endpoint/test-results/real-user-tests/pages/filter?window=1w' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"searchFilters\": { \"platform\": [ \"mac\" ], \"domain\": [ \"thousandeyes.com\" ], \"networkId\": [ \"660b34109d12\", \"660b34109d15\" ] }}' ``` Returns a `results` array of user loaded pages in an endpoint real user test. Pages shown are from the latest round, or based on the time range specified. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param real_user_endpoint_test_result_request_filter: + :type real_user_endpoint_test_result_request_filter: RealUserEndpointTestResultRequestFilter + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_real_user_tests_visited_pages_results_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + real_user_endpoint_test_result_request_filter=real_user_endpoint_test_result_request_filter, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RealUserEndpointTestPageResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _filter_real_user_tests_visited_pages_results_serialize( + self, + aid, + window, + start_date, + end_date, + cursor, + real_user_endpoint_test_result_request_filter, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + if real_user_endpoint_test_result_request_filter is not None: + _body_params = real_user_endpoint_test_result_request_filter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/test-results/real-user-tests/pages/filter', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_real_user_test_page_results( + self, + id: Annotated[StrictStr, Field(description="The real user test id.")], + page_id: Annotated[StrictStr, Field(description="Web page ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RealUserEndpointTestPageDetailResult: + """Retrieve endpoint real user test page + + Returns details for endpoint real user test web page request. Provides complete waterfall information with all object requests. Sends back detailed endpoint real user test web page request. Returned object has a single field: `har` which is an HAR object according to the HTTP Archive 1.2 specifications. [You can read more about the specification](http://www.softwareishard.com/blog/har-12-spec/). In addition to standard fields, the object har includes a custom property `systemMetrics` which contain metrics about CPU and physical memory usage. Check `SystemMetrics` on schemas tab for more information. + + :param id: The real user test id. (required) + :type id: str + :param page_id: Web page ID (required) + :type page_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_real_user_test_page_results_serialize( + id=id, + page_id=page_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RealUserEndpointTestPageDetailResult", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ).data + + + @validate_call + def get_real_user_test_page_results_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The real user test id.")], + page_id: Annotated[StrictStr, Field(description="Web page ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RealUserEndpointTestPageDetailResult]: + """Retrieve endpoint real user test page + + Returns details for endpoint real user test web page request. Provides complete waterfall information with all object requests. Sends back detailed endpoint real user test web page request. Returned object has a single field: `har` which is an HAR object according to the HTTP Archive 1.2 specifications. [You can read more about the specification](http://www.softwareishard.com/blog/har-12-spec/). In addition to standard fields, the object har includes a custom property `systemMetrics` which contain metrics about CPU and physical memory usage. Check `SystemMetrics` on schemas tab for more information. + + :param id: The real user test id. (required) + :type id: str + :param page_id: Web page ID (required) + :type page_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_real_user_test_page_results_serialize( + id=id, + page_id=page_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RealUserEndpointTestPageDetailResult", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ) + + + @validate_call + def get_real_user_test_page_results_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The real user test id.")], + page_id: Annotated[StrictStr, Field(description="Web page ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve endpoint real user test page + + Returns details for endpoint real user test web page request. Provides complete waterfall information with all object requests. Sends back detailed endpoint real user test web page request. Returned object has a single field: `har` which is an HAR object according to the HTTP Archive 1.2 specifications. [You can read more about the specification](http://www.softwareishard.com/blog/har-12-spec/). In addition to standard fields, the object har includes a custom property `systemMetrics` which contain metrics about CPU and physical memory usage. Check `SystemMetrics` on schemas tab for more information. + + :param id: The real user test id. (required) + :type id: str + :param page_id: Web page ID (required) + :type page_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_real_user_test_page_results_serialize( + id=id, + page_id=page_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RealUserEndpointTestPageDetailResult", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_real_user_test_page_results_serialize( + self, + id, + page_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + if page_id is not None: + _path_params['pageId'] = page_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/test-results/real-user-tests/{id}/pages/{pageId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_real_user_test_results( + self, + id: Annotated[StrictStr, Field(description="The real user test id.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RealUserEndpointTestDetailResults: + """Retrieve endpoint real user test + + Provides details for an endpoint real user test. Returns a results array containing detailed information about endpoint real user tests.\" + + :param id: The real user test id. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_real_user_test_results_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RealUserEndpointTestDetailResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ).data + + + @validate_call + def get_real_user_test_results_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The real user test id.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RealUserEndpointTestDetailResults]: + """Retrieve endpoint real user test + + Provides details for an endpoint real user test. Returns a results array containing detailed information about endpoint real user tests.\" + + :param id: The real user test id. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_real_user_test_results_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RealUserEndpointTestDetailResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_test_results.models, + ) + + + @validate_call + def get_real_user_test_results_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The real user test id.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve endpoint real user test + + Provides details for an endpoint real user test. Returns a results array containing detailed information about endpoint real user tests.\" + + :param id: The real user test id. (required) + :type id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_real_user_test_results_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RealUserEndpointTestDetailResults", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_real_user_test_results_serialize( + self, + id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/test-results/real-user-tests/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/__init__.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/__init__.py index 6c756e3b9..49b421c1c 100644 --- a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/__init__.py +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/__init__.py @@ -13,21 +13,17 @@ # import models into model package -from thousandeyes_sdk.endpoint_test_results.models.alert_direction import AlertDirection -from thousandeyes_sdk.endpoint_test_results.models.alert_rounds_violation_mode import AlertRoundsViolationMode -from thousandeyes_sdk.endpoint_test_results.models.alert_rule import AlertRule -from thousandeyes_sdk.endpoint_test_results.models.alert_type import AlertType from thousandeyes_sdk.endpoint_test_results.models.application_score_quality import ApplicationScoreQuality from thousandeyes_sdk.endpoint_test_results.models.asn_details import AsnDetails from thousandeyes_sdk.endpoint_test_results.models.conditional_operator import ConditionalOperator from thousandeyes_sdk.endpoint_test_results.models.cpu_utilization import CpuUtilization -from thousandeyes_sdk.endpoint_test_results.models.dynamic_base_test_result import DynamicBaseTestResult +from thousandeyes_sdk.endpoint_test_results.models.dynamic_base_endpoint_test_result import DynamicBaseEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.dynamic_endpoint_test_webex import DynamicEndpointTestWebex +from thousandeyes_sdk.endpoint_test_results.models.dynamic_endpoint_tests_data_round_search import DynamicEndpointTestsDataRoundSearch +from thousandeyes_sdk.endpoint_test_results.models.dynamic_endpoint_tests_data_search_filter import DynamicEndpointTestsDataSearchFilter from thousandeyes_sdk.endpoint_test_results.models.dynamic_test import DynamicTest from thousandeyes_sdk.endpoint_test_results.models.dynamic_test_links import DynamicTestLinks from thousandeyes_sdk.endpoint_test_results.models.dynamic_test_self_link import DynamicTestSelfLink -from thousandeyes_sdk.endpoint_test_results.models.dynamic_test_webex import DynamicTestWebex -from thousandeyes_sdk.endpoint_test_results.models.dynamic_tests_data_round_search import DynamicTestsDataRoundSearch -from thousandeyes_sdk.endpoint_test_results.models.dynamic_tests_data_search_filter import DynamicTestsDataSearchFilter from thousandeyes_sdk.endpoint_test_results.models.endpoint_agent_labels_selector_config import EndpointAgentLabelsSelectorConfig from thousandeyes_sdk.endpoint_test_results.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig from thousandeyes_sdk.endpoint_test_results.models.endpoint_agent_to_server_test import EndpointAgentToServerTest @@ -38,40 +34,43 @@ from thousandeyes_sdk.endpoint_test_results.models.endpoint_http_server_test import EndpointHttpServerTest from thousandeyes_sdk.endpoint_test_results.models.endpoint_network_topology_result_request import EndpointNetworkTopologyResultRequest from thousandeyes_sdk.endpoint_test_results.models.endpoint_network_topology_result_request_filter import EndpointNetworkTopologyResultRequestFilter +from thousandeyes_sdk.endpoint_test_results.models.endpoint_path_trace import EndpointPathTrace +from thousandeyes_sdk.endpoint_test_results.models.endpoint_path_vis_hop import EndpointPathVisHop +from thousandeyes_sdk.endpoint_test_results.models.endpoint_path_vis_route import EndpointPathVisRoute from thousandeyes_sdk.endpoint_test_results.models.endpoint_ping_data_point_score import EndpointPingDataPointScore -from thousandeyes_sdk.endpoint_test_results.models.endpoint_real_user_test import EndpointRealUserTest -from thousandeyes_sdk.endpoint_test_results.models.endpoint_real_user_test_base import EndpointRealUserTestBase -from thousandeyes_sdk.endpoint_test_results.models.endpoint_real_user_test_detail import EndpointRealUserTestDetail -from thousandeyes_sdk.endpoint_test_results.models.endpoint_real_user_test_detail_results import EndpointRealUserTestDetailResults -from thousandeyes_sdk.endpoint_test_results.models.endpoint_real_user_test_result_request_filter import EndpointRealUserTestResultRequestFilter -from thousandeyes_sdk.endpoint_test_results.models.endpoint_real_user_test_results import EndpointRealUserTestResults -from thousandeyes_sdk.endpoint_test_results.models.endpoint_real_user_test_results_request import EndpointRealUserTestResultsRequest from thousandeyes_sdk.endpoint_test_results.models.endpoint_result_request_filter import EndpointResultRequestFilter from thousandeyes_sdk.endpoint_test_results.models.endpoint_scheduled_test import EndpointScheduledTest from thousandeyes_sdk.endpoint_test_results.models.endpoint_scheduled_test_type import EndpointScheduledTestType from thousandeyes_sdk.endpoint_test_results.models.endpoint_specific_agents_selector_config import EndpointSpecificAgentsSelectorConfig from thousandeyes_sdk.endpoint_test_results.models.endpoint_test import EndpointTest from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_auth_type import EndpointTestAuthType +from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_ethernet_profile import EndpointTestEthernetProfile from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_links import EndpointTestLinks from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_protocol import EndpointTestProtocol +from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_result import EndpointTestResult from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_result_protocol import EndpointTestResultProtocol from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_self_link import EndpointTestSelfLink +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_rounds_search import EndpointTestsDataRoundsSearch +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_search_filter import EndpointTestsDataSearchFilter +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_search_sort import EndpointTestsDataSearchSort +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_search_sort_key import EndpointTestsDataSearchSortKey +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_threshold_filter import EndpointTestsDataThresholdFilter +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_threshold_filters import EndpointTestsDataThresholdFilters from thousandeyes_sdk.endpoint_test_results.models.error import Error -from thousandeyes_sdk.endpoint_test_results.models.ethernet_profile import EthernetProfile -from thousandeyes_sdk.endpoint_test_results.models.expand import Expand +from thousandeyes_sdk.endpoint_test_results.models.expand_endpoint_http_server_options import ExpandEndpointHttpServerOptions from thousandeyes_sdk.endpoint_test_results.models.gateway_network_ping import GatewayNetworkPing from thousandeyes_sdk.endpoint_test_results.models.hop import Hop +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_test_result import HttpEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_test_result_headers import HttpEndpointTestResultHeaders +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_test_results import HttpEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_rounds_search import HttpEndpointTestsDataRoundsSearch +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_search_filter import HttpEndpointTestsDataSearchFilter +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_search_sort import HttpEndpointTestsDataSearchSort +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_search_sort_key import HttpEndpointTestsDataSearchSortKey +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_threshold_filter import HttpEndpointTestsDataThresholdFilter +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_threshold_filters import HttpEndpointTestsDataThresholdFilters from thousandeyes_sdk.endpoint_test_results.models.http_error_type import HttpErrorType -from thousandeyes_sdk.endpoint_test_results.models.http_multi_test_results import HttpMultiTestResults -from thousandeyes_sdk.endpoint_test_results.models.http_test_result import HttpTestResult -from thousandeyes_sdk.endpoint_test_results.models.http_test_result_headers import HttpTestResultHeaders -from thousandeyes_sdk.endpoint_test_results.models.http_test_results import HttpTestResults -from thousandeyes_sdk.endpoint_test_results.models.http_tests_data_rounds_search import HttpTestsDataRoundsSearch -from thousandeyes_sdk.endpoint_test_results.models.http_tests_data_search_filter import HttpTestsDataSearchFilter -from thousandeyes_sdk.endpoint_test_results.models.http_tests_data_search_sort import HttpTestsDataSearchSort -from thousandeyes_sdk.endpoint_test_results.models.http_tests_data_search_sort_key import HttpTestsDataSearchSortKey -from thousandeyes_sdk.endpoint_test_results.models.http_tests_data_threshold_filter import HttpTestsDataThresholdFilter -from thousandeyes_sdk.endpoint_test_results.models.http_tests_data_threshold_filters import HttpTestsDataThresholdFilters +from thousandeyes_sdk.endpoint_test_results.models.http_multi_endpoint_test_results import HttpMultiEndpointTestResults from thousandeyes_sdk.endpoint_test_results.models.http_threshold_filter_name import HttpThresholdFilterName from thousandeyes_sdk.endpoint_test_results.models.interface_hardware_type import InterfaceHardwareType from thousandeyes_sdk.endpoint_test_results.models.link import Link @@ -81,49 +80,51 @@ from thousandeyes_sdk.endpoint_test_results.models.local_network_topology_result import LocalNetworkTopologyResult from thousandeyes_sdk.endpoint_test_results.models.local_network_topology_result_base import LocalNetworkTopologyResultBase from thousandeyes_sdk.endpoint_test_results.models.local_network_topology_results import LocalNetworkTopologyResults -from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_network_test_results import MultiTestIdNetworkTestResults -from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_tests_data_rounds_search import MultiTestIdTestsDataRoundsSearch -from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_tests_data_search_filter import MultiTestIdTestsDataSearchFilter -from thousandeyes_sdk.endpoint_test_results.models.network_dynamic_test_result import NetworkDynamicTestResult -from thousandeyes_sdk.endpoint_test_results.models.network_dynamic_test_results import NetworkDynamicTestResults +from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_endpoint_tests_data_rounds_search import MultiTestIdEndpointTestsDataRoundsSearch +from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_endpoint_tests_data_search_filter import MultiTestIdEndpointTestsDataSearchFilter +from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_network_endpoint_test_results import MultiTestIdNetworkEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.network_dynamic_endpoint_test_result import NetworkDynamicEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.network_dynamic_endpoint_test_results import NetworkDynamicEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.network_endpoint_test_result import NetworkEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.network_endpoint_test_results import NetworkEndpointTestResults from thousandeyes_sdk.endpoint_test_results.models.network_interface import NetworkInterface from thousandeyes_sdk.endpoint_test_results.models.network_metrics import NetworkMetrics from thousandeyes_sdk.endpoint_test_results.models.network_ping import NetworkPing from thousandeyes_sdk.endpoint_test_results.models.network_profile import NetworkProfile from thousandeyes_sdk.endpoint_test_results.models.network_proxy import NetworkProxy from thousandeyes_sdk.endpoint_test_results.models.network_proxy_profile import NetworkProxyProfile -from thousandeyes_sdk.endpoint_test_results.models.network_test_result import NetworkTestResult -from thousandeyes_sdk.endpoint_test_results.models.network_test_results import NetworkTestResults from thousandeyes_sdk.endpoint_test_results.models.network_topology_type import NetworkTopologyType from thousandeyes_sdk.endpoint_test_results.models.network_wireless_profile import NetworkWirelessProfile from thousandeyes_sdk.endpoint_test_results.models.pagination_next_and_self_link import PaginationNextAndSelfLink from thousandeyes_sdk.endpoint_test_results.models.pagination_next_link import PaginationNextLink -from thousandeyes_sdk.endpoint_test_results.models.path_vis_base_test_result import PathVisBaseTestResult -from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_dynamic_test_result import PathVisDetailDynamicTestResult -from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_dynamic_test_results import PathVisDetailDynamicTestResults -from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_test_result import PathVisDetailTestResult -from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_test_results import PathVisDetailTestResults -from thousandeyes_sdk.endpoint_test_results.models.path_vis_dynamic_test_result import PathVisDynamicTestResult -from thousandeyes_sdk.endpoint_test_results.models.path_vis_dynamic_test_results import PathVisDynamicTestResults -from thousandeyes_sdk.endpoint_test_results.models.path_vis_endpoint import PathVisEndpoint -from thousandeyes_sdk.endpoint_test_results.models.path_vis_hop import PathVisHop -from thousandeyes_sdk.endpoint_test_results.models.path_vis_route import PathVisRoute -from thousandeyes_sdk.endpoint_test_results.models.path_vis_test_result import PathVisTestResult -from thousandeyes_sdk.endpoint_test_results.models.path_vis_test_results import PathVisTestResults +from thousandeyes_sdk.endpoint_test_results.models.path_vis_base_endpoint_test_result import PathVisBaseEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_dynamic_endpoint_test_result import PathVisDetailDynamicEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_dynamic_endpoint_test_results import PathVisDetailDynamicEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_endpoint_test_result import PathVisDetailEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_endpoint_test_results import PathVisDetailEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.path_vis_dynamic_endpoint_test_result import PathVisDynamicEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.path_vis_dynamic_endpoint_test_results import PathVisDynamicEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.path_vis_endpoint_test_result import PathVisEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.path_vis_endpoint_test_results import PathVisEndpointTestResults from thousandeyes_sdk.endpoint_test_results.models.physical_memory_used_bytes import PhysicalMemoryUsedBytes from thousandeyes_sdk.endpoint_test_results.models.platform import Platform -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_coordinates import RealUserTestCoordinates -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_network import RealUserTestNetwork -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_network_result import RealUserTestNetworkResult -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_network_results import RealUserTestNetworkResults -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_page import RealUserTestPage -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_page_detail_result import RealUserTestPageDetailResult -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_page_result import RealUserTestPageResult -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_page_results import RealUserTestPageResults -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_page_timings import RealUserTestPageTimings +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test import RealUserEndpointTest +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_base import RealUserEndpointTestBase +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_coordinates import RealUserEndpointTestCoordinates +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_detail import RealUserEndpointTestDetail +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_detail_results import RealUserEndpointTestDetailResults +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_network import RealUserEndpointTestNetwork +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_network_result import RealUserEndpointTestNetworkResult +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_network_results import RealUserEndpointTestNetworkResults +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page import RealUserEndpointTestPage +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_detail_result import RealUserEndpointTestPageDetailResult +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_result import RealUserEndpointTestPageResult +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_results import RealUserEndpointTestPageResults +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_timings import RealUserEndpointTestPageTimings +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_result_request_filter import RealUserEndpointTestResultRequestFilter +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_results import RealUserEndpointTestResults +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_results_request import RealUserEndpointTestResultsRequest from thousandeyes_sdk.endpoint_test_results.models.self_links import SelfLinks -from thousandeyes_sdk.endpoint_test_results.models.sensitivity_level import SensitivityLevel -from thousandeyes_sdk.endpoint_test_results.models.severity import Severity from thousandeyes_sdk.endpoint_test_results.models.sort_order import SortOrder from thousandeyes_sdk.endpoint_test_results.models.system_metrics import SystemMetrics from thousandeyes_sdk.endpoint_test_results.models.target_network_ping import TargetNetworkPing @@ -135,14 +136,7 @@ from thousandeyes_sdk.endpoint_test_results.models.test_label import TestLabel from thousandeyes_sdk.endpoint_test_results.models.test_probe_mode_response import TestProbeModeResponse from thousandeyes_sdk.endpoint_test_results.models.test_protocol import TestProtocol -from thousandeyes_sdk.endpoint_test_results.models.test_result import TestResult from thousandeyes_sdk.endpoint_test_results.models.test_ssl_version_id import TestSslVersionId -from thousandeyes_sdk.endpoint_test_results.models.tests_data_rounds_search import TestsDataRoundsSearch -from thousandeyes_sdk.endpoint_test_results.models.tests_data_search_filter import TestsDataSearchFilter -from thousandeyes_sdk.endpoint_test_results.models.tests_data_search_sort import TestsDataSearchSort -from thousandeyes_sdk.endpoint_test_results.models.tests_data_search_sort_key import TestsDataSearchSortKey -from thousandeyes_sdk.endpoint_test_results.models.tests_data_threshold_filter import TestsDataThresholdFilter -from thousandeyes_sdk.endpoint_test_results.models.tests_data_threshold_filters import TestsDataThresholdFilters from thousandeyes_sdk.endpoint_test_results.models.threshold_filter_name import ThresholdFilterName from thousandeyes_sdk.endpoint_test_results.models.threshold_filter_operator import ThresholdFilterOperator from thousandeyes_sdk.endpoint_test_results.models.traceroute import Traceroute diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/dynamic_base_endpoint_test_result.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/dynamic_base_endpoint_test_result.py new file mode 100644 index 000000000..9c6896afa --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/dynamic_base_endpoint_test_result.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.dynamic_endpoint_test_webex import DynamicEndpointTestWebex +from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_result_protocol import EndpointTestResultProtocol +from thousandeyes_sdk.endpoint_test_results.models.test_probe_mode_response import TestProbeModeResponse +from thousandeyes_sdk.endpoint_test_results.models.udp_probe_mode_response import UdpProbeModeResponse +from typing import Optional, Set +from typing_extensions import Self + +class DynamicBaseEndpointTestResult(BaseModel): + """ + DynamicBaseEndpointTestResult + """ # noqa: E501 + application: Optional[StrictStr] = Field(default=None, description="Which supported application to monitor, can be one of `webex`, `zoom`, `microsoft-teams`.") + protocol: Optional[EndpointTestResultProtocol] = None + tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") + udp_probe_mode: Optional[UdpProbeModeResponse] = Field(default=None, alias="udpProbeMode") + webex: Optional[DynamicEndpointTestWebex] = None + __properties: ClassVar[List[str]] = ["application", "protocol", "tcpProbeMode", "udpProbeMode", "webex"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DynamicBaseEndpointTestResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of webex + if self.webex: + _dict['webex'] = self.webex.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DynamicBaseEndpointTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "application": obj.get("application"), + "protocol": obj.get("protocol"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "udpProbeMode": obj.get("udpProbeMode"), + "webex": DynamicEndpointTestWebex.from_dict(obj["webex"]) if obj.get("webex") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/dynamic_endpoint_test_webex.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/dynamic_endpoint_test_webex.py new file mode 100644 index 000000000..58255da25 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/dynamic_endpoint_test_webex.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DynamicEndpointTestWebex(BaseModel): + """ + Contains object with webex information. Only returned for webex applications. + """ # noqa: E501 + conference_id: Optional[StrictStr] = Field(default=None, description="Webex conference ID.", alias="conferenceId") + correlation_id: Optional[StrictStr] = Field(default=None, description="Webex conference correlation ID.", alias="correlationId") + local_sip_session_id: Optional[StrictStr] = Field(default=None, description="Webex calling local sip session ID.", alias="localSipSessionId") + remote_sip_session_id: Optional[StrictStr] = Field(default=None, description="Webex calling remote sip session ID.", alias="remoteSipSessionId") + __properties: ClassVar[List[str]] = ["conferenceId", "correlationId", "localSipSessionId", "remoteSipSessionId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DynamicEndpointTestWebex from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "conference_id", + "correlation_id", + "local_sip_session_id", + "remote_sip_session_id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DynamicEndpointTestWebex from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conferenceId": obj.get("conferenceId"), + "correlationId": obj.get("correlationId"), + "localSipSessionId": obj.get("localSipSessionId"), + "remoteSipSessionId": obj.get("remoteSipSessionId") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/dynamic_endpoint_tests_data_round_search.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/dynamic_endpoint_tests_data_round_search.py new file mode 100644 index 000000000..61511fa0b --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/dynamic_endpoint_tests_data_round_search.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.dynamic_endpoint_tests_data_search_filter import DynamicEndpointTestsDataSearchFilter +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_search_sort import EndpointTestsDataSearchSort +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_threshold_filters import EndpointTestsDataThresholdFilters +from typing import Optional, Set +from typing_extensions import Self + +class DynamicEndpointTestsDataRoundSearch(BaseModel): + """ + DynamicEndpointTestsDataRoundSearch + """ # noqa: E501 + search_sort: Optional[List[EndpointTestsDataSearchSort]] = Field(default=None, alias="searchSort") + threshold_filter: Optional[EndpointTestsDataThresholdFilters] = Field(default=None, alias="thresholdFilter") + search_filters: Optional[DynamicEndpointTestsDataSearchFilter] = Field(default=None, alias="searchFilters") + __properties: ClassVar[List[str]] = ["searchSort", "thresholdFilter", "searchFilters"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DynamicEndpointTestsDataRoundSearch from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in search_sort (list) + _items = [] + if self.search_sort: + for _item in self.search_sort: + if _item: + _items.append(_item.to_dict()) + _dict['searchSort'] = _items + # override the default output from pydantic by calling `to_dict()` of threshold_filter + if self.threshold_filter: + _dict['thresholdFilter'] = self.threshold_filter.to_dict() + # override the default output from pydantic by calling `to_dict()` of search_filters + if self.search_filters: + _dict['searchFilters'] = self.search_filters.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DynamicEndpointTestsDataRoundSearch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "searchSort": [EndpointTestsDataSearchSort.from_dict(_item) for _item in obj["searchSort"]] if obj.get("searchSort") is not None else None, + "thresholdFilter": EndpointTestsDataThresholdFilters.from_dict(obj["thresholdFilter"]) if obj.get("thresholdFilter") is not None else None, + "searchFilters": DynamicEndpointTestsDataSearchFilter.from_dict(obj["searchFilters"]) if obj.get("searchFilters") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/dynamic_endpoint_tests_data_search_filter.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/dynamic_endpoint_tests_data_search_filter.py new file mode 100644 index 000000000..176c9219c --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/dynamic_endpoint_tests_data_search_filter.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DynamicEndpointTestsDataSearchFilter(BaseModel): + """ + DynamicEndpointTestsDataSearchFilter + """ # noqa: E501 + agent_id: Optional[List[StrictStr]] = Field(default=None, description="Filter using the `agent-id`.", alias="agentId") + webex_conference_id: Optional[List[StrictStr]] = Field(default=None, description="Filter using the `conference-id` of the webex call.", alias="webexConferenceId") + __properties: ClassVar[List[str]] = ["agentId", "webexConferenceId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DynamicEndpointTestsDataSearchFilter from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DynamicEndpointTestsDataSearchFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "webexConferenceId": obj.get("webexConferenceId") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_agent_labels_selector_config.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_agent_labels_selector_config.py index c3b64ab65..26a63aec9 100644 --- a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_agent_labels_selector_config.py +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_agent_labels_selector_config.py @@ -27,7 +27,7 @@ class EndpointAgentLabelsSelectorConfig(BaseModel): Agent labels selection object. """ # noqa: E501 agent_selector_type: Annotated[str, Field(strict=True)] = Field(alias="agentSelectorType") - max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines", "endpointAgentLabels"] @@ -91,7 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "agentSelectorType": obj.get("agentSelectorType"), - "maxMachines": obj.get("maxMachines"), + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25, "endpointAgentLabels": obj.get("endpointAgentLabels") }) return _obj diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_agent_to_server_test.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_agent_to_server_test.py index 77e54fc82..51cf35124 100644 --- a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_agent_to_server_test.py +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_agent_to_server_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.endpoint_test_results.models.alert_rule import AlertRule from thousandeyes_sdk.endpoint_test_results.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_links import EndpointTestLinks from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_protocol import EndpointTestProtocol @@ -44,16 +43,15 @@ class EndpointAgentToServerTest(BaseModel): has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") - port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") protocol: Optional[EndpointTestProtocol] = None server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") type: Annotated[str, Field(strict=True)] = Field(description="Type of test being queried.") tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") - alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + port: Optional[StrictInt] = Field(default=443, description="Port number.") labels: Optional[List[TestLabel]] = None - __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "alertRules", "labels"] + __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "port", "labels"] @field_validator('type') def type_validate_regular_expression(cls, value): @@ -120,13 +118,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of agent_selector_config if self.agent_selector_config: _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) - _items = [] - if self.alert_rules: - for _item in self.alert_rules: - if _item: - _items.append(_item.to_dict()) - _dict['alertRules'] = _items # override the default output from pydantic by calling `to_dict()` of each item in labels (list) _items = [] if self.labels: @@ -156,14 +147,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "hasPathTraceInSession": obj.get("hasPathTraceInSession"), "modifiedDate": obj.get("modifiedDate"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, - "port": obj.get("port"), "protocol": obj.get("protocol"), "server": obj.get("server"), "testId": obj.get("testId"), "testName": obj.get("testName"), "type": obj.get("type"), "tcpProbeMode": obj.get("tcpProbeMode"), - "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "port": obj.get("port") if obj.get("port") is not None else 443, "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None }) return _obj diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_all_agents_selector_config.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_all_agents_selector_config.py index 9691aa447..62aa71369 100644 --- a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_all_agents_selector_config.py +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_all_agents_selector_config.py @@ -27,7 +27,7 @@ class EndpointAllAgentsSelectorConfig(BaseModel): Any agent selection object. """ # noqa: E501 agent_selector_type: Annotated[str, Field(strict=True)] = Field(alias="agentSelectorType") - max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines"] @field_validator('agent_selector_type') @@ -90,7 +90,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "agentSelectorType": obj.get("agentSelectorType"), - "maxMachines": obj.get("maxMachines") + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25 }) return _obj diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_http_server_base_test.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_http_server_base_test.py index 599084a84..55765c1bb 100644 --- a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_http_server_base_test.py +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_http_server_base_test.py @@ -31,14 +31,14 @@ class EndpointHttpServerBaseTest(BaseModel): """ # noqa: E501 auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") - http_time_limit: Optional[StrictInt] = Field(default=None, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") + http_time_limit: Optional[StrictInt] = Field(default=5000, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") protocol: Optional[EndpointTestProtocol] = None - url: Optional[StrictStr] = Field(default=None, description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") - verify_certificate: Optional[StrictBool] = Field(default=None, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") - __properties: ClassVar[List[str]] = ["authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "url", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate"] + verify_certificate: Optional[StrictBool] = Field(default=True, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + url: Optional[StrictStr] = Field(default=None, description="The test target URL.") + __properties: ClassVar[List[str]] = ["authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate", "url"] model_config = ConfigDict( populate_by_name=True, @@ -94,13 +94,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "authType": obj.get("authType"), "hasPathTraceInSession": obj.get("hasPathTraceInSession"), - "httpTimeLimit": obj.get("httpTimeLimit"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5000, "protocol": obj.get("protocol"), - "url": obj.get("url"), "username": obj.get("username"), "sslVersionId": obj.get("sslVersionId"), "tcpProbeMode": obj.get("tcpProbeMode"), - "verifyCertificate": obj.get("verifyCertificate") + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else True, + "url": obj.get("url") }) return _obj diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_http_server_test.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_http_server_test.py index cb141606f..ce391fbae 100644 --- a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_http_server_test.py +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_http_server_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.endpoint_test_results.models.alert_rule import AlertRule from thousandeyes_sdk.endpoint_test_results.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_auth_type import EndpointTestAuthType from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_links import EndpointTestLinks @@ -46,30 +45,26 @@ class EndpointHttpServerTest(BaseModel): has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") - port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") protocol: Optional[EndpointTestProtocol] = None server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") type: Annotated[str, Field(strict=True)] = Field(description="Type of test being queried.") tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") - alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + port: Optional[StrictInt] = Field(default=443, description="Port number.") auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") - http_time_limit: Optional[StrictInt] = Field(default=None, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") - url: Optional[StrictStr] = Field(default=None, description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") + http_time_limit: Optional[StrictInt] = Field(default=5000, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") - verify_certificate: Optional[StrictBool] = Field(default=None, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") - content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + verify_certificate: Optional[StrictBool] = Field(default=True, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + url: Optional[StrictStr] = Field(default=None, description="The test target URL.") follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") - post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") - user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") labels: Optional[List[TestLabel]] = None - __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "alertRules", "authType", "httpTimeLimit", "url", "username", "sslVersionId", "verifyCertificate", "contentRegex", "followRedirects", "httpTargetTime", "httpVersion", "postBody", "sslVersion", "useNtlm", "userAgent", "labels"] + __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "port", "authType", "httpTimeLimit", "username", "sslVersionId", "verifyCertificate", "url", "followRedirects", "httpTargetTime", "httpVersion", "sslVersion", "useNtlm", "labels"] @field_validator('type') def type_validate_regular_expression(cls, value): @@ -138,13 +133,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of agent_selector_config if self.agent_selector_config: _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) - _items = [] - if self.alert_rules: - for _item in self.alert_rules: - if _item: - _items.append(_item.to_dict()) - _dict['alertRules'] = _items # override the default output from pydantic by calling `to_dict()` of each item in labels (list) _items = [] if self.labels: @@ -174,28 +162,24 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "hasPathTraceInSession": obj.get("hasPathTraceInSession"), "modifiedDate": obj.get("modifiedDate"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, - "port": obj.get("port"), "protocol": obj.get("protocol"), "server": obj.get("server"), "testId": obj.get("testId"), "testName": obj.get("testName"), "type": obj.get("type"), "tcpProbeMode": obj.get("tcpProbeMode"), - "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "port": obj.get("port") if obj.get("port") is not None else 443, "authType": obj.get("authType"), - "httpTimeLimit": obj.get("httpTimeLimit"), - "url": obj.get("url"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5000, "username": obj.get("username"), "sslVersionId": obj.get("sslVersionId"), - "verifyCertificate": obj.get("verifyCertificate"), - "contentRegex": obj.get("contentRegex"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else True, + "url": obj.get("url"), "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, "httpTargetTime": obj.get("httpTargetTime"), "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, - "postBody": obj.get("postBody"), "sslVersion": obj.get("sslVersion"), "useNtlm": obj.get("useNtlm"), - "userAgent": obj.get("userAgent"), "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None }) return _obj diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_path_trace.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_path_trace.py new file mode 100644 index 000000000..dc328b627 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_path_trace.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_result_protocol import EndpointTestResultProtocol +from thousandeyes_sdk.endpoint_test_results.models.tcp_path_trace_mode_response import TcpPathTraceModeResponse +from thousandeyes_sdk.endpoint_test_results.models.udp_path_trace_mode_response import UdpPathTraceModeResponse +from typing import Optional, Set +from typing_extensions import Self + +class EndpointPathTrace(BaseModel): + """ + EndpointPathTrace + """ # noqa: E501 + ip_address: Optional[StrictStr] = Field(default=None, description="IP address of the hop destination.", alias="ipAddress") + number_of_hops: Optional[StrictInt] = Field(default=None, description="Number of hops for path trace to destination.", alias="numberOfHops") + protocol: Optional[EndpointTestResultProtocol] = None + tcp_path_trace_mode: Optional[TcpPathTraceModeResponse] = Field(default=None, alias="tcpPathTraceMode") + udp_path_trace_mode: Optional[UdpPathTraceModeResponse] = Field(default=None, alias="udpPathTraceMode") + path_id: Optional[StrictStr] = Field(default=None, description="Unique ID of path trace.", alias="pathId") + response_time: Optional[StrictInt] = Field(default=None, description="RTT of the path trace to the destination in milliseconds.", alias="responseTime") + __properties: ClassVar[List[str]] = ["ipAddress", "numberOfHops", "protocol", "tcpPathTraceMode", "udpPathTraceMode", "pathId", "responseTime"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EndpointPathTrace from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "ip_address", + "number_of_hops", + "path_id", + "response_time", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EndpointPathTrace from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ipAddress": obj.get("ipAddress"), + "numberOfHops": obj.get("numberOfHops"), + "protocol": obj.get("protocol"), + "tcpPathTraceMode": obj.get("tcpPathTraceMode"), + "udpPathTraceMode": obj.get("udpPathTraceMode"), + "pathId": obj.get("pathId"), + "responseTime": obj.get("responseTime") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_path_vis_hop.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_path_vis_hop.py new file mode 100644 index 000000000..4c5098c62 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_path_vis_hop.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class EndpointPathVisHop(BaseModel): + """ + EndpointPathVisHop + """ # noqa: E501 + hop: Optional[StrictInt] = Field(default=None, description="The hop index.") + ip_address: Optional[StrictStr] = Field(default=None, description="IP address of the hop.", alias="ipAddress") + prefix: Optional[StrictStr] = Field(default=None, description="Prefix of IP address shown in CIDR.") + rdns: Optional[StrictStr] = Field(default=None, description="Reverse DNS entry of IP, if available.") + network: Optional[StrictStr] = Field(default=None, description="Autonomous System originating the prefix.") + response_time: Optional[StrictInt] = Field(default=None, description="RTT to the hop’s IP in milliseconds.", alias="responseTime") + location: Optional[StrictStr] = Field(default=None, description="Location information for the hop.") + __properties: ClassVar[List[str]] = ["hop", "ipAddress", "prefix", "rdns", "network", "responseTime", "location"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EndpointPathVisHop from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "hop", + "ip_address", + "prefix", + "rdns", + "network", + "response_time", + "location", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EndpointPathVisHop from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "hop": obj.get("hop"), + "ipAddress": obj.get("ipAddress"), + "prefix": obj.get("prefix"), + "rdns": obj.get("rdns"), + "network": obj.get("network"), + "responseTime": obj.get("responseTime"), + "location": obj.get("location") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_path_vis_route.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_path_vis_route.py new file mode 100644 index 000000000..3cf3d65b4 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_path_vis_route.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.endpoint_path_vis_hop import EndpointPathVisHop +from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_result_protocol import EndpointTestResultProtocol +from thousandeyes_sdk.endpoint_test_results.models.tcp_path_trace_mode_response import TcpPathTraceModeResponse +from thousandeyes_sdk.endpoint_test_results.models.udp_path_trace_mode_response import UdpPathTraceModeResponse +from typing import Optional, Set +from typing_extensions import Self + +class EndpointPathVisRoute(BaseModel): + """ + EndpointPathVisRoute + """ # noqa: E501 + path_id: Optional[StrictStr] = Field(default=None, description="Unique ID of path trace.", alias="pathId") + protocol: Optional[EndpointTestResultProtocol] = None + tcp_path_trace_mode: Optional[TcpPathTraceModeResponse] = Field(default=None, alias="tcpPathTraceMode") + udp_path_trace_mode: Optional[UdpPathTraceModeResponse] = Field(default=None, alias="udpPathTraceMode") + hops: Optional[List[EndpointPathVisHop]] = Field(default=None, description="Array of hop objects indicating each step in the traceroute.") + __properties: ClassVar[List[str]] = ["pathId", "protocol", "tcpPathTraceMode", "udpPathTraceMode", "hops"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EndpointPathVisRoute from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "path_id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in hops (list) + _items = [] + if self.hops: + for _item in self.hops: + if _item: + _items.append(_item.to_dict()) + _dict['hops'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EndpointPathVisRoute from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "pathId": obj.get("pathId"), + "protocol": obj.get("protocol"), + "tcpPathTraceMode": obj.get("tcpPathTraceMode"), + "udpPathTraceMode": obj.get("udpPathTraceMode"), + "hops": [EndpointPathVisHop.from_dict(_item) for _item in obj["hops"]] if obj.get("hops") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_specific_agents_selector_config.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_specific_agents_selector_config.py index cc9c2f90f..b9243a009 100644 --- a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_specific_agents_selector_config.py +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_specific_agents_selector_config.py @@ -27,7 +27,7 @@ class EndpointSpecificAgentsSelectorConfig(BaseModel): Specific agents selection object. """ # noqa: E501 agent_selector_type: Annotated[str, Field(strict=True)] = Field(alias="agentSelectorType") - max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines", "agents"] @@ -91,7 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "agentSelectorType": obj.get("agentSelectorType"), - "maxMachines": obj.get("maxMachines"), + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25, "agents": obj.get("agents") }) return _obj diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test.py index e86ca1412..b4412bba2 100644 --- a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test.py +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test.py @@ -19,7 +19,6 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.endpoint_test_results.models.alert_rule import AlertRule from thousandeyes_sdk.endpoint_test_results.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig from thousandeyes_sdk.endpoint_test_results.models.endpoint_scheduled_test_type import EndpointScheduledTestType from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_links import EndpointTestLinks @@ -43,15 +42,14 @@ class EndpointTest(BaseModel): has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") - port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") protocol: Optional[EndpointTestProtocol] = None server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") type: EndpointScheduledTestType tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") - alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") - __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "alertRules"] + port: Optional[StrictInt] = Field(default=443, description="Port number.") + __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "port"] model_config = ConfigDict( populate_by_name=True, @@ -107,13 +105,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of agent_selector_config if self.agent_selector_config: _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) - _items = [] - if self.alert_rules: - for _item in self.alert_rules: - if _item: - _items.append(_item.to_dict()) - _dict['alertRules'] = _items return _dict @classmethod @@ -136,14 +127,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "hasPathTraceInSession": obj.get("hasPathTraceInSession"), "modifiedDate": obj.get("modifiedDate"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, - "port": obj.get("port"), "protocol": obj.get("protocol"), "server": obj.get("server"), "testId": obj.get("testId"), "testName": obj.get("testName"), "type": obj.get("type"), "tcpProbeMode": obj.get("tcpProbeMode"), - "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None + "port": obj.get("port") if obj.get("port") is not None else 443 }) return _obj diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test_ethernet_profile.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test_ethernet_profile.py new file mode 100644 index 000000000..0d203be48 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test_ethernet_profile.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class EndpointTestEthernetProfile(BaseModel): + """ + EndpointTestEthernetProfile + """ # noqa: E501 + link_speed: Optional[StrictInt] = Field(default=None, description="Ethernet profile link speed", alias="linkSpeed") + __properties: ClassVar[List[str]] = ["linkSpeed"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EndpointTestEthernetProfile from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "link_speed", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EndpointTestEthernetProfile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "linkSpeed": obj.get("linkSpeed") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test_result.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test_result.py new file mode 100644 index 000000000..61fab118b --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_test_result.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.network_profile import NetworkProfile +from thousandeyes_sdk.endpoint_test_results.models.system_metrics import SystemMetrics +from thousandeyes_sdk.endpoint_test_results.models.target_profile import TargetProfile +from thousandeyes_sdk.endpoint_test_results.models.vpn_profile import VpnProfile +from typing import Optional, Set +from typing_extensions import Self + +class EndpointTestResult(BaseModel): + """ + EndpointTestResult + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + test_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint test.", alias="testId") + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of target server.", alias="serverIp") + network_profile: Optional[NetworkProfile] = Field(default=None, alias="networkProfile") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + original_target_profile: Optional[TargetProfile] = Field(default=None, alias="originalTargetProfile") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + __properties: ClassVar[List[str]] = ["aid", "testId", "agentId", "roundId", "serverIp", "networkProfile", "systemMetrics", "originalTargetProfile", "vpnProfile"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EndpointTestResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "test_id", + "agent_id", + "round_id", + "server_ip", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of network_profile + if self.network_profile: + _dict['networkProfile'] = self.network_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of original_target_profile + if self.original_target_profile: + _dict['originalTargetProfile'] = self.original_target_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EndpointTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "testId": obj.get("testId"), + "agentId": obj.get("agentId"), + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "networkProfile": NetworkProfile.from_dict(obj["networkProfile"]) if obj.get("networkProfile") is not None else None, + "systemMetrics": SystemMetrics.from_dict(obj["systemMetrics"]) if obj.get("systemMetrics") is not None else None, + "originalTargetProfile": TargetProfile.from_dict(obj["originalTargetProfile"]) if obj.get("originalTargetProfile") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj["vpnProfile"]) if obj.get("vpnProfile") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_rounds_search.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_rounds_search.py new file mode 100644 index 000000000..2e4c7a00e --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_rounds_search.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_search_filter import EndpointTestsDataSearchFilter +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_search_sort import EndpointTestsDataSearchSort +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_threshold_filters import EndpointTestsDataThresholdFilters +from typing import Optional, Set +from typing_extensions import Self + +class EndpointTestsDataRoundsSearch(BaseModel): + """ + EndpointTestsDataRoundsSearch + """ # noqa: E501 + search_sort: Optional[List[EndpointTestsDataSearchSort]] = Field(default=None, alias="searchSort") + threshold_filter: Optional[EndpointTestsDataThresholdFilters] = Field(default=None, alias="thresholdFilter") + search_filters: Optional[EndpointTestsDataSearchFilter] = Field(default=None, alias="searchFilters") + __properties: ClassVar[List[str]] = ["searchSort", "thresholdFilter", "searchFilters"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EndpointTestsDataRoundsSearch from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in search_sort (list) + _items = [] + if self.search_sort: + for _item in self.search_sort: + if _item: + _items.append(_item.to_dict()) + _dict['searchSort'] = _items + # override the default output from pydantic by calling `to_dict()` of threshold_filter + if self.threshold_filter: + _dict['thresholdFilter'] = self.threshold_filter.to_dict() + # override the default output from pydantic by calling `to_dict()` of search_filters + if self.search_filters: + _dict['searchFilters'] = self.search_filters.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EndpointTestsDataRoundsSearch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "searchSort": [EndpointTestsDataSearchSort.from_dict(_item) for _item in obj["searchSort"]] if obj.get("searchSort") is not None else None, + "thresholdFilter": EndpointTestsDataThresholdFilters.from_dict(obj["thresholdFilter"]) if obj.get("thresholdFilter") is not None else None, + "searchFilters": EndpointTestsDataSearchFilter.from_dict(obj["searchFilters"]) if obj.get("searchFilters") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_search_filter.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_search_filter.py new file mode 100644 index 000000000..4bdffb533 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_search_filter.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class EndpointTestsDataSearchFilter(BaseModel): + """ + EndpointTestsDataSearchFilter + """ # noqa: E501 + agent_id: Optional[List[StrictStr]] = Field(default=None, description="Filter using the `agent-id`.", alias="agentId") + __properties: ClassVar[List[str]] = ["agentId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EndpointTestsDataSearchFilter from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EndpointTestsDataSearchFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_search_sort.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_search_sort.py new file mode 100644 index 000000000..471fb384c --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_search_sort.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_search_sort_key import EndpointTestsDataSearchSortKey +from thousandeyes_sdk.endpoint_test_results.models.sort_order import SortOrder +from typing import Optional, Set +from typing_extensions import Self + +class EndpointTestsDataSearchSort(BaseModel): + """ + EndpointTestsDataSearchSort + """ # noqa: E501 + sort: Optional[EndpointTestsDataSearchSortKey] = None + order: Optional[SortOrder] = None + __properties: ClassVar[List[str]] = ["sort", "order"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EndpointTestsDataSearchSort from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EndpointTestsDataSearchSort from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "sort": obj.get("sort"), + "order": obj.get("order") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_search_sort_key.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_search_sort_key.py new file mode 100644 index 000000000..b3a259053 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_search_sort_key.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class EndpointTestsDataSearchSortKey(str, Enum): + """ + EndpointTestsDataSearchSortKey + """ + + """ + allowed enum values + """ + ROUND_MINUS_ID = 'round-id' + LOSS = 'loss' + LATENCY = 'latency' + JITTER = 'jitter' + CPU = 'cpu' + MEMORY = 'memory' + SIGNAL_MINUS_QUALITY = 'signal-quality' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointTestsDataSearchSortKey from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_threshold_filter.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_threshold_filter.py new file mode 100644 index 000000000..4660f2d3a --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_threshold_filter.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from thousandeyes_sdk.endpoint_test_results.models.threshold_filter_name import ThresholdFilterName +from thousandeyes_sdk.endpoint_test_results.models.threshold_filter_operator import ThresholdFilterOperator +from typing import Optional, Set +from typing_extensions import Self + +class EndpointTestsDataThresholdFilter(BaseModel): + """ + The metric is filtered based on the threshold value and operator provided. + """ # noqa: E501 + name: Optional[ThresholdFilterName] = None + value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The threshold value.") + operator: Optional[ThresholdFilterOperator] = None + __properties: ClassVar[List[str]] = ["name", "value", "operator"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EndpointTestsDataThresholdFilter from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EndpointTestsDataThresholdFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "value": obj.get("value"), + "operator": obj.get("operator") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_threshold_filters.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_threshold_filters.py new file mode 100644 index 000000000..13de55a9f --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/endpoint_tests_data_threshold_filters.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.conditional_operator import ConditionalOperator +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_threshold_filter import EndpointTestsDataThresholdFilter +from typing import Optional, Set +from typing_extensions import Self + +class EndpointTestsDataThresholdFilters(BaseModel): + """ + All filters are applied based on the conditional operator (and/or). + """ # noqa: E501 + filters: Optional[List[EndpointTestsDataThresholdFilter]] = None + conditional_operator: Optional[ConditionalOperator] = Field(default=None, alias="conditionalOperator") + __properties: ClassVar[List[str]] = ["filters", "conditionalOperator"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EndpointTestsDataThresholdFilters from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in filters (list) + _items = [] + if self.filters: + for _item in self.filters: + if _item: + _items.append(_item.to_dict()) + _dict['filters'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EndpointTestsDataThresholdFilters from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "filters": [EndpointTestsDataThresholdFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None, + "conditionalOperator": obj.get("conditionalOperator") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/expand_endpoint_http_server_options.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/expand_endpoint_http_server_options.py new file mode 100644 index 000000000..ec060cb7e --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/expand_endpoint_http_server_options.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ExpandEndpointHttpServerOptions(str, Enum): + """ + ExpandEndpointHttpServerOptions + """ + + """ + allowed enum values + """ + HEADER = 'header' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ExpandEndpointHttpServerOptions from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_test_result.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_test_result.py new file mode 100644 index 000000000..1d7720e2c --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_test_result.py @@ -0,0 +1,184 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_test_result_headers import HttpEndpointTestResultHeaders +from thousandeyes_sdk.endpoint_test_results.models.http_error_type import HttpErrorType +from thousandeyes_sdk.endpoint_test_results.models.network_profile import NetworkProfile +from thousandeyes_sdk.endpoint_test_results.models.system_metrics import SystemMetrics +from thousandeyes_sdk.endpoint_test_results.models.target_profile import TargetProfile +from thousandeyes_sdk.endpoint_test_results.models.vpn_profile import VpnProfile +from typing import Optional, Set +from typing_extensions import Self + +class HttpEndpointTestResult(BaseModel): + """ + HttpEndpointTestResult + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + test_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint test.", alias="testId") + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of destination server.", alias="serverIp") + network_profile: Optional[NetworkProfile] = Field(default=None, alias="networkProfile") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + original_target_profile: Optional[TargetProfile] = Field(default=None, alias="originalTargetProfile") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + connect_time: Optional[StrictInt] = Field(default=None, description="Time required to establish a TCP connection to the server in milliseconds.", alias="connectTime") + dns_time: Optional[StrictInt] = Field(default=None, description="Time required to resolve DNS in milliseconds.", alias="dnsTime") + error_type: Optional[HttpErrorType] = Field(default=None, alias="errorType") + error_details: Optional[StrictStr] = Field(default=None, description="Error details, if an error were encountered.", alias="errorDetails") + headers: Optional[HttpEndpointTestResultHeaders] = None + num_redirects: Optional[StrictInt] = Field(default=None, description="Number of redirects.", alias="numRedirects") + receive_time: Optional[StrictInt] = Field(default=None, description="Elapsed time between first and last byte of response in milliseconds.", alias="receiveTime") + redirect_time: Optional[StrictInt] = Field(default=None, description="Cumulative redirect timing in milliseconds.", alias="redirectTime") + response_code: Optional[StrictInt] = Field(default=None, description="HTTP response code.", alias="responseCode") + response_time: Optional[StrictInt] = Field(default=None, description="Time to first byte in milliseconds.", alias="responseTime") + ssl_time: Optional[StrictInt] = Field(default=None, description="Time to negotiate SSL/TLS in milliseconds.", alias="sslTime") + total_time: Optional[StrictInt] = Field(default=None, description="Total time is the response time + receive time.", alias="totalTime") + wait_time: Optional[StrictInt] = Field(default=None, description="Time elapsed between completion of request and first byte of response in milliseconds.", alias="waitTime") + wire_size: Optional[StrictInt] = Field(default=None, description="Size of content in bytes.", alias="wireSize") + __properties: ClassVar[List[str]] = ["aid", "testId", "agentId", "roundId", "serverIp", "networkProfile", "systemMetrics", "originalTargetProfile", "vpnProfile", "connectTime", "dnsTime", "errorType", "errorDetails", "headers", "numRedirects", "receiveTime", "redirectTime", "responseCode", "responseTime", "sslTime", "totalTime", "waitTime", "wireSize"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HttpEndpointTestResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "test_id", + "agent_id", + "round_id", + "server_ip", + "connect_time", + "dns_time", + "error_details", + "num_redirects", + "receive_time", + "redirect_time", + "response_code", + "response_time", + "ssl_time", + "total_time", + "wait_time", + "wire_size", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of network_profile + if self.network_profile: + _dict['networkProfile'] = self.network_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of original_target_profile + if self.original_target_profile: + _dict['originalTargetProfile'] = self.original_target_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of headers + if self.headers: + _dict['headers'] = self.headers.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HttpEndpointTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "testId": obj.get("testId"), + "agentId": obj.get("agentId"), + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "networkProfile": NetworkProfile.from_dict(obj["networkProfile"]) if obj.get("networkProfile") is not None else None, + "systemMetrics": SystemMetrics.from_dict(obj["systemMetrics"]) if obj.get("systemMetrics") is not None else None, + "originalTargetProfile": TargetProfile.from_dict(obj["originalTargetProfile"]) if obj.get("originalTargetProfile") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj["vpnProfile"]) if obj.get("vpnProfile") is not None else None, + "connectTime": obj.get("connectTime"), + "dnsTime": obj.get("dnsTime"), + "errorType": obj.get("errorType"), + "errorDetails": obj.get("errorDetails"), + "headers": HttpEndpointTestResultHeaders.from_dict(obj["headers"]) if obj.get("headers") is not None else None, + "numRedirects": obj.get("numRedirects"), + "receiveTime": obj.get("receiveTime"), + "redirectTime": obj.get("redirectTime"), + "responseCode": obj.get("responseCode"), + "responseTime": obj.get("responseTime"), + "sslTime": obj.get("sslTime"), + "totalTime": obj.get("totalTime"), + "waitTime": obj.get("waitTime"), + "wireSize": obj.get("wireSize") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_test_result_headers.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_test_result_headers.py new file mode 100644 index 000000000..9f6902899 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_test_result_headers.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class HttpEndpointTestResultHeaders(BaseModel): + """ + Expandable object containing both request and response headers. + """ # noqa: E501 + request_headers: Optional[StrictStr] = Field(default=None, description="CRLF-delimited list of request headers in `header: value` format.", alias="requestHeaders") + response_headers: Optional[StrictStr] = Field(default=None, description="CRLF-delimited list of response headers in `header: value` format.", alias="responseHeaders") + __properties: ClassVar[List[str]] = ["requestHeaders", "responseHeaders"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HttpEndpointTestResultHeaders from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "request_headers", + "response_headers", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HttpEndpointTestResultHeaders from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "requestHeaders": obj.get("requestHeaders"), + "responseHeaders": obj.get("responseHeaders") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_test_results.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_test_results.py new file mode 100644 index 000000000..3473a2eac --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_test_results.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.endpoint_http_server_test import EndpointHttpServerTest +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_test_result import HttpEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.pagination_next_and_self_link import PaginationNextAndSelfLink +from typing import Optional, Set +from typing_extensions import Self + +class HttpEndpointTestResults(BaseModel): + """ + HttpEndpointTestResults + """ # noqa: E501 + results: Optional[List[HttpEndpointTestResult]] = None + test: Optional[EndpointHttpServerTest] = None + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + links: Optional[PaginationNextAndSelfLink] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "startDate", "endDate", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HttpEndpointTestResults from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "start_date", + "end_date", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HttpEndpointTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [HttpEndpointTestResult.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "test": EndpointHttpServerTest.from_dict(obj["test"]) if obj.get("test") is not None else None, + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "_links": PaginationNextAndSelfLink.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_rounds_search.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_rounds_search.py new file mode 100644 index 000000000..b213028c4 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_rounds_search.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_search_filter import HttpEndpointTestsDataSearchFilter +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_search_sort import HttpEndpointTestsDataSearchSort +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_threshold_filters import HttpEndpointTestsDataThresholdFilters +from typing import Optional, Set +from typing_extensions import Self + +class HttpEndpointTestsDataRoundsSearch(BaseModel): + """ + HttpEndpointTestsDataRoundsSearch + """ # noqa: E501 + search_sort: Optional[List[HttpEndpointTestsDataSearchSort]] = Field(default=None, alias="searchSort") + threshold_filter: Optional[HttpEndpointTestsDataThresholdFilters] = Field(default=None, alias="thresholdFilter") + search_filters: Optional[HttpEndpointTestsDataSearchFilter] = Field(default=None, alias="searchFilters") + __properties: ClassVar[List[str]] = ["searchSort", "thresholdFilter", "searchFilters"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HttpEndpointTestsDataRoundsSearch from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in search_sort (list) + _items = [] + if self.search_sort: + for _item in self.search_sort: + if _item: + _items.append(_item.to_dict()) + _dict['searchSort'] = _items + # override the default output from pydantic by calling `to_dict()` of threshold_filter + if self.threshold_filter: + _dict['thresholdFilter'] = self.threshold_filter.to_dict() + # override the default output from pydantic by calling `to_dict()` of search_filters + if self.search_filters: + _dict['searchFilters'] = self.search_filters.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HttpEndpointTestsDataRoundsSearch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "searchSort": [HttpEndpointTestsDataSearchSort.from_dict(_item) for _item in obj["searchSort"]] if obj.get("searchSort") is not None else None, + "thresholdFilter": HttpEndpointTestsDataThresholdFilters.from_dict(obj["thresholdFilter"]) if obj.get("thresholdFilter") is not None else None, + "searchFilters": HttpEndpointTestsDataSearchFilter.from_dict(obj["searchFilters"]) if obj.get("searchFilters") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_search_filter.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_search_filter.py new file mode 100644 index 000000000..2518e950e --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_search_filter.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class HttpEndpointTestsDataSearchFilter(BaseModel): + """ + HttpEndpointTestsDataSearchFilter + """ # noqa: E501 + test_id: Optional[List[StrictStr]] = Field(default=None, description="Filter by test", alias="testId") + agent_id: Optional[List[StrictStr]] = Field(default=None, description="Filter using the `agent-id`.", alias="agentId") + __properties: ClassVar[List[str]] = ["testId", "agentId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HttpEndpointTestsDataSearchFilter from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HttpEndpointTestsDataSearchFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "testId": obj.get("testId"), + "agentId": obj.get("agentId") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_search_sort.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_search_sort.py new file mode 100644 index 000000000..e9522b619 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_search_sort.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_search_sort_key import HttpEndpointTestsDataSearchSortKey +from thousandeyes_sdk.endpoint_test_results.models.sort_order import SortOrder +from typing import Optional, Set +from typing_extensions import Self + +class HttpEndpointTestsDataSearchSort(BaseModel): + """ + HttpEndpointTestsDataSearchSort + """ # noqa: E501 + sort: Optional[HttpEndpointTestsDataSearchSortKey] = None + order: Optional[SortOrder] = None + __properties: ClassVar[List[str]] = ["sort", "order"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HttpEndpointTestsDataSearchSort from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HttpEndpointTestsDataSearchSort from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "sort": obj.get("sort"), + "order": obj.get("order") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_search_sort_key.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_search_sort_key.py new file mode 100644 index 000000000..99deac822 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_search_sort_key.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class HttpEndpointTestsDataSearchSortKey(str, Enum): + """ + HttpEndpointTestsDataSearchSortKey + """ + + """ + allowed enum values + """ + ROUND_MINUS_ID = 'round-id' + RESPONSE_MINUS_TIME = 'response-time' + DNS_MINUS_TIME = 'dns-time' + CONNECT_MINUS_TIME = 'connect-time' + SSL_MINUS_TIME = 'ssl-time' + WAIT_MINUS_TIME = 'wait-time' + RESPONSE_MINUS_CODE = 'response-code' + WIRE_MINUS_SIZE = 'wire-size' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of HttpEndpointTestsDataSearchSortKey from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_threshold_filter.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_threshold_filter.py new file mode 100644 index 000000000..d3e24a468 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_threshold_filter.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from thousandeyes_sdk.endpoint_test_results.models.http_threshold_filter_name import HttpThresholdFilterName +from thousandeyes_sdk.endpoint_test_results.models.threshold_filter_operator import ThresholdFilterOperator +from typing import Optional, Set +from typing_extensions import Self + +class HttpEndpointTestsDataThresholdFilter(BaseModel): + """ + The metric is filtered based on the threshold value and operator provided. + """ # noqa: E501 + name: Optional[HttpThresholdFilterName] = None + value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The threshold value.") + operator: Optional[ThresholdFilterOperator] = None + __properties: ClassVar[List[str]] = ["name", "value", "operator"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HttpEndpointTestsDataThresholdFilter from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HttpEndpointTestsDataThresholdFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "value": obj.get("value"), + "operator": obj.get("operator") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_threshold_filters.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_threshold_filters.py new file mode 100644 index 000000000..49f4ab796 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_endpoint_tests_data_threshold_filters.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.conditional_operator import ConditionalOperator +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_tests_data_threshold_filter import HttpEndpointTestsDataThresholdFilter +from typing import Optional, Set +from typing_extensions import Self + +class HttpEndpointTestsDataThresholdFilters(BaseModel): + """ + All filters are applied based on the conditional operator (and/or). + """ # noqa: E501 + filters: Optional[List[HttpEndpointTestsDataThresholdFilter]] = None + conditional_operator: Optional[ConditionalOperator] = Field(default=None, alias="conditionalOperator") + __properties: ClassVar[List[str]] = ["filters", "conditionalOperator"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HttpEndpointTestsDataThresholdFilters from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in filters (list) + _items = [] + if self.filters: + for _item in self.filters: + if _item: + _items.append(_item.to_dict()) + _dict['filters'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HttpEndpointTestsDataThresholdFilters from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "filters": [HttpEndpointTestsDataThresholdFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None, + "conditionalOperator": obj.get("conditionalOperator") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_multi_endpoint_test_results.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_multi_endpoint_test_results.py new file mode 100644 index 000000000..1de5bf870 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/http_multi_endpoint_test_results.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.http_endpoint_test_result import HttpEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.pagination_next_and_self_link import PaginationNextAndSelfLink +from typing import Optional, Set +from typing_extensions import Self + +class HttpMultiEndpointTestResults(BaseModel): + """ + HttpMultiEndpointTestResults + """ # noqa: E501 + results: Optional[List[HttpEndpointTestResult]] = None + total_hits: Optional[StrictInt] = Field(default=None, description="Total number of measurements that match the search criteria", alias="totalHits") + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + links: Optional[PaginationNextAndSelfLink] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "totalHits", "startDate", "endDate", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HttpMultiEndpointTestResults from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "start_date", + "end_date", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HttpMultiEndpointTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [HttpEndpointTestResult.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "totalHits": obj.get("totalHits"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "_links": PaginationNextAndSelfLink.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/local_network_topology_result.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/local_network_topology_result.py index 6f0746f1d..38f01e54d 100644 --- a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/local_network_topology_result.py +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/local_network_topology_result.py @@ -22,7 +22,7 @@ from thousandeyes_sdk.endpoint_test_results.models.network_ping import NetworkPing from thousandeyes_sdk.endpoint_test_results.models.network_profile import NetworkProfile from thousandeyes_sdk.endpoint_test_results.models.network_topology_type import NetworkTopologyType -from thousandeyes_sdk.endpoint_test_results.models.real_user_test_coordinates import RealUserTestCoordinates +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_coordinates import RealUserEndpointTestCoordinates from thousandeyes_sdk.endpoint_test_results.models.system_metrics import SystemMetrics from thousandeyes_sdk.endpoint_test_results.models.tcp_connect import TcpConnect from thousandeyes_sdk.endpoint_test_results.models.traceroute import Traceroute @@ -44,7 +44,7 @@ class LocalNetworkTopologyResult(BaseModel): is_icmp_blocked: Optional[StrictBool] = Field(default=None, description="Set to `true` if network target is blocking ICMP echo (ping) queries.", alias="isIcmpBlocked") tcp_connect: Optional[TcpConnect] = Field(default=None, alias="tcpConnect") system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") - coordinates: Optional[RealUserTestCoordinates] = None + coordinates: Optional[RealUserEndpointTestCoordinates] = None network_profile: Optional[NetworkProfile] = Field(default=None, alias="networkProfile") icmp_traceroute: Optional[Traceroute] = Field(default=None, alias="icmpTraceroute") icmp_traceroutes: Optional[List[Traceroute]] = Field(default=None, alias="icmpTraceroutes") @@ -152,7 +152,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "isIcmpBlocked": obj.get("isIcmpBlocked"), "tcpConnect": TcpConnect.from_dict(obj["tcpConnect"]) if obj.get("tcpConnect") is not None else None, "systemMetrics": SystemMetrics.from_dict(obj["systemMetrics"]) if obj.get("systemMetrics") is not None else None, - "coordinates": RealUserTestCoordinates.from_dict(obj["coordinates"]) if obj.get("coordinates") is not None else None, + "coordinates": RealUserEndpointTestCoordinates.from_dict(obj["coordinates"]) if obj.get("coordinates") is not None else None, "networkProfile": NetworkProfile.from_dict(obj["networkProfile"]) if obj.get("networkProfile") is not None else None, "icmpTraceroute": Traceroute.from_dict(obj["icmpTraceroute"]) if obj.get("icmpTraceroute") is not None else None, "icmpTraceroutes": [Traceroute.from_dict(_item) for _item in obj["icmpTraceroutes"]] if obj.get("icmpTraceroutes") is not None else None diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_endpoint_tests_data_rounds_search.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_endpoint_tests_data_rounds_search.py new file mode 100644 index 000000000..98353368b --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_endpoint_tests_data_rounds_search.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_search_sort import EndpointTestsDataSearchSort +from thousandeyes_sdk.endpoint_test_results.models.endpoint_tests_data_threshold_filters import EndpointTestsDataThresholdFilters +from thousandeyes_sdk.endpoint_test_results.models.multi_test_id_endpoint_tests_data_search_filter import MultiTestIdEndpointTestsDataSearchFilter +from typing import Optional, Set +from typing_extensions import Self + +class MultiTestIdEndpointTestsDataRoundsSearch(BaseModel): + """ + MultiTestIdEndpointTestsDataRoundsSearch + """ # noqa: E501 + search_sort: Optional[List[EndpointTestsDataSearchSort]] = Field(default=None, alias="searchSort") + threshold_filter: Optional[EndpointTestsDataThresholdFilters] = Field(default=None, alias="thresholdFilter") + search_filters: Optional[MultiTestIdEndpointTestsDataSearchFilter] = Field(default=None, alias="searchFilters") + __properties: ClassVar[List[str]] = ["searchSort", "thresholdFilter", "searchFilters"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MultiTestIdEndpointTestsDataRoundsSearch from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in search_sort (list) + _items = [] + if self.search_sort: + for _item in self.search_sort: + if _item: + _items.append(_item.to_dict()) + _dict['searchSort'] = _items + # override the default output from pydantic by calling `to_dict()` of threshold_filter + if self.threshold_filter: + _dict['thresholdFilter'] = self.threshold_filter.to_dict() + # override the default output from pydantic by calling `to_dict()` of search_filters + if self.search_filters: + _dict['searchFilters'] = self.search_filters.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MultiTestIdEndpointTestsDataRoundsSearch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "searchSort": [EndpointTestsDataSearchSort.from_dict(_item) for _item in obj["searchSort"]] if obj.get("searchSort") is not None else None, + "thresholdFilter": EndpointTestsDataThresholdFilters.from_dict(obj["thresholdFilter"]) if obj.get("thresholdFilter") is not None else None, + "searchFilters": MultiTestIdEndpointTestsDataSearchFilter.from_dict(obj["searchFilters"]) if obj.get("searchFilters") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_endpoint_tests_data_search_filter.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_endpoint_tests_data_search_filter.py new file mode 100644 index 000000000..e70191d26 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_endpoint_tests_data_search_filter.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class MultiTestIdEndpointTestsDataSearchFilter(BaseModel): + """ + MultiTestIdEndpointTestsDataSearchFilter + """ # noqa: E501 + agent_id: Optional[List[StrictStr]] = Field(default=None, description="Filter using the `agent-id`.", alias="agentId") + test_id: Optional[List[StrictStr]] = Field(default=None, alias="testId") + __properties: ClassVar[List[str]] = ["agentId", "testId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MultiTestIdEndpointTestsDataSearchFilter from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MultiTestIdEndpointTestsDataSearchFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "testId": obj.get("testId") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_network_endpoint_test_results.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_network_endpoint_test_results.py new file mode 100644 index 000000000..696e9dc3f --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/multi_test_id_network_endpoint_test_results.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.network_endpoint_test_result import NetworkEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.pagination_next_link import PaginationNextLink +from typing import Optional, Set +from typing_extensions import Self + +class MultiTestIdNetworkEndpointTestResults(BaseModel): + """ + MultiTestIdNetworkEndpointTestResults + """ # noqa: E501 + results: Optional[List[NetworkEndpointTestResult]] = None + total_hits: Optional[StrictInt] = Field(default=None, description="Total number of measurements that match the search criteria", alias="totalHits") + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + links: Optional[PaginationNextLink] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "totalHits", "startDate", "endDate", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MultiTestIdNetworkEndpointTestResults from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "start_date", + "end_date", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MultiTestIdNetworkEndpointTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [NetworkEndpointTestResult.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "totalHits": obj.get("totalHits"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "_links": PaginationNextLink.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_dynamic_endpoint_test_result.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_dynamic_endpoint_test_result.py new file mode 100644 index 000000000..54e0dd746 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_dynamic_endpoint_test_result.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from thousandeyes_sdk.endpoint_test_results.models.dynamic_endpoint_test_webex import DynamicEndpointTestWebex +from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_result_protocol import EndpointTestResultProtocol +from thousandeyes_sdk.endpoint_test_results.models.network_profile import NetworkProfile +from thousandeyes_sdk.endpoint_test_results.models.system_metrics import SystemMetrics +from thousandeyes_sdk.endpoint_test_results.models.target_profile import TargetProfile +from thousandeyes_sdk.endpoint_test_results.models.test_probe_mode_response import TestProbeModeResponse +from thousandeyes_sdk.endpoint_test_results.models.udp_probe_mode_response import UdpProbeModeResponse +from thousandeyes_sdk.endpoint_test_results.models.vpn_profile import VpnProfile +from typing import Optional, Set +from typing_extensions import Self + +class NetworkDynamicEndpointTestResult(BaseModel): + """ + NetworkDynamicEndpointTestResult + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + test_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint test.", alias="testId") + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of target server.", alias="serverIp") + network_profile: Optional[NetworkProfile] = Field(default=None, alias="networkProfile") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + original_target_profile: Optional[TargetProfile] = Field(default=None, alias="originalTargetProfile") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + avg_latency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Average RTT for packets sent to destination.", alias="avgLatency") + error_details: Optional[StrictStr] = Field(default=None, description="Error details, if an error was encountered.", alias="errorDetails") + jitter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Standard deviation of latency.") + is_icmp_blocked: Optional[StrictBool] = Field(default=None, description="Set to `true` if network target is blocking ICMP echo (ping) queries.", alias="isIcmpBlocked") + loss: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Percentage of packets not reaching destination.") + max_latency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum RTT for packets sent to destination.", alias="maxLatency") + min_latency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Minimum RTT for packets sent to destination.", alias="minLatency") + application: Optional[StrictStr] = Field(default=None, description="Which supported application to monitor, can be one of `webex`, `zoom`, `microsoft-teams`.") + protocol: Optional[EndpointTestResultProtocol] = None + tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") + udp_probe_mode: Optional[UdpProbeModeResponse] = Field(default=None, alias="udpProbeMode") + webex: Optional[DynamicEndpointTestWebex] = None + __properties: ClassVar[List[str]] = ["aid", "testId", "agentId", "roundId", "serverIp", "networkProfile", "systemMetrics", "originalTargetProfile", "vpnProfile", "avgLatency", "errorDetails", "jitter", "isIcmpBlocked", "loss", "maxLatency", "minLatency", "application", "protocol", "tcpProbeMode", "udpProbeMode", "webex"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NetworkDynamicEndpointTestResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "test_id", + "agent_id", + "round_id", + "server_ip", + "avg_latency", + "error_details", + "jitter", + "is_icmp_blocked", + "loss", + "max_latency", + "min_latency", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of network_profile + if self.network_profile: + _dict['networkProfile'] = self.network_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of original_target_profile + if self.original_target_profile: + _dict['originalTargetProfile'] = self.original_target_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of webex + if self.webex: + _dict['webex'] = self.webex.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NetworkDynamicEndpointTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "testId": obj.get("testId"), + "agentId": obj.get("agentId"), + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "networkProfile": NetworkProfile.from_dict(obj["networkProfile"]) if obj.get("networkProfile") is not None else None, + "systemMetrics": SystemMetrics.from_dict(obj["systemMetrics"]) if obj.get("systemMetrics") is not None else None, + "originalTargetProfile": TargetProfile.from_dict(obj["originalTargetProfile"]) if obj.get("originalTargetProfile") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj["vpnProfile"]) if obj.get("vpnProfile") is not None else None, + "avgLatency": obj.get("avgLatency"), + "errorDetails": obj.get("errorDetails"), + "jitter": obj.get("jitter"), + "isIcmpBlocked": obj.get("isIcmpBlocked"), + "loss": obj.get("loss"), + "maxLatency": obj.get("maxLatency"), + "minLatency": obj.get("minLatency"), + "application": obj.get("application"), + "protocol": obj.get("protocol"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "udpProbeMode": obj.get("udpProbeMode"), + "webex": DynamicEndpointTestWebex.from_dict(obj["webex"]) if obj.get("webex") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_dynamic_endpoint_test_results.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_dynamic_endpoint_test_results.py new file mode 100644 index 000000000..51c7b328a --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_dynamic_endpoint_test_results.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.dynamic_test import DynamicTest +from thousandeyes_sdk.endpoint_test_results.models.network_dynamic_endpoint_test_result import NetworkDynamicEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.pagination_next_link import PaginationNextLink +from typing import Optional, Set +from typing_extensions import Self + +class NetworkDynamicEndpointTestResults(BaseModel): + """ + NetworkDynamicEndpointTestResults + """ # noqa: E501 + results: Optional[List[NetworkDynamicEndpointTestResult]] = None + test: Optional[DynamicTest] = None + total_hits: Optional[StrictInt] = Field(default=None, description="Total number of measurements that match the search criteria", alias="totalHits") + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + links: Optional[PaginationNextLink] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "totalHits", "startDate", "endDate", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NetworkDynamicEndpointTestResults from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "start_date", + "end_date", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NetworkDynamicEndpointTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [NetworkDynamicEndpointTestResult.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "test": DynamicTest.from_dict(obj["test"]) if obj.get("test") is not None else None, + "totalHits": obj.get("totalHits"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "_links": PaginationNextLink.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_endpoint_test_result.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_endpoint_test_result.py new file mode 100644 index 000000000..9bc43ad59 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_endpoint_test_result.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from thousandeyes_sdk.endpoint_test_results.models.network_profile import NetworkProfile +from thousandeyes_sdk.endpoint_test_results.models.system_metrics import SystemMetrics +from thousandeyes_sdk.endpoint_test_results.models.target_profile import TargetProfile +from thousandeyes_sdk.endpoint_test_results.models.vpn_profile import VpnProfile +from typing import Optional, Set +from typing_extensions import Self + +class NetworkEndpointTestResult(BaseModel): + """ + NetworkEndpointTestResult + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + test_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint test.", alias="testId") + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of target server.", alias="serverIp") + network_profile: Optional[NetworkProfile] = Field(default=None, alias="networkProfile") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + original_target_profile: Optional[TargetProfile] = Field(default=None, alias="originalTargetProfile") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + avg_latency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Average RTT for packets sent to destination.", alias="avgLatency") + error_details: Optional[StrictStr] = Field(default=None, description="Error details, if an error was encountered.", alias="errorDetails") + jitter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Standard deviation of latency.") + is_icmp_blocked: Optional[StrictBool] = Field(default=None, description="Set to `true` if network target is blocking ICMP echo (ping) queries.", alias="isIcmpBlocked") + loss: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Percentage of packets not reaching destination.") + max_latency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum RTT for packets sent to destination.", alias="maxLatency") + min_latency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Minimum RTT for packets sent to destination.", alias="minLatency") + __properties: ClassVar[List[str]] = ["aid", "testId", "agentId", "roundId", "serverIp", "networkProfile", "systemMetrics", "originalTargetProfile", "vpnProfile", "avgLatency", "errorDetails", "jitter", "isIcmpBlocked", "loss", "maxLatency", "minLatency"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NetworkEndpointTestResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "test_id", + "agent_id", + "round_id", + "server_ip", + "avg_latency", + "error_details", + "jitter", + "is_icmp_blocked", + "loss", + "max_latency", + "min_latency", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of network_profile + if self.network_profile: + _dict['networkProfile'] = self.network_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of original_target_profile + if self.original_target_profile: + _dict['originalTargetProfile'] = self.original_target_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NetworkEndpointTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "testId": obj.get("testId"), + "agentId": obj.get("agentId"), + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "networkProfile": NetworkProfile.from_dict(obj["networkProfile"]) if obj.get("networkProfile") is not None else None, + "systemMetrics": SystemMetrics.from_dict(obj["systemMetrics"]) if obj.get("systemMetrics") is not None else None, + "originalTargetProfile": TargetProfile.from_dict(obj["originalTargetProfile"]) if obj.get("originalTargetProfile") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj["vpnProfile"]) if obj.get("vpnProfile") is not None else None, + "avgLatency": obj.get("avgLatency"), + "errorDetails": obj.get("errorDetails"), + "jitter": obj.get("jitter"), + "isIcmpBlocked": obj.get("isIcmpBlocked"), + "loss": obj.get("loss"), + "maxLatency": obj.get("maxLatency"), + "minLatency": obj.get("minLatency") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_endpoint_test_results.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_endpoint_test_results.py new file mode 100644 index 000000000..a7bc297fd --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_endpoint_test_results.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.endpoint_scheduled_test import EndpointScheduledTest +from thousandeyes_sdk.endpoint_test_results.models.network_endpoint_test_result import NetworkEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.pagination_next_link import PaginationNextLink +from typing import Optional, Set +from typing_extensions import Self + +class NetworkEndpointTestResults(BaseModel): + """ + NetworkEndpointTestResults + """ # noqa: E501 + results: Optional[List[NetworkEndpointTestResult]] = None + total_hits: Optional[StrictInt] = Field(default=None, description="Total number of measurements that match the search criteria", alias="totalHits") + test: Optional[EndpointScheduledTest] = None + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + links: Optional[PaginationNextLink] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "totalHits", "test", "startDate", "endDate", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NetworkEndpointTestResults from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "start_date", + "end_date", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NetworkEndpointTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [NetworkEndpointTestResult.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "totalHits": obj.get("totalHits"), + "test": EndpointScheduledTest.from_dict(obj["test"]) if obj.get("test") is not None else None, + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "_links": PaginationNextLink.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_profile.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_profile.py index 85389acd4..a879b49ba 100644 --- a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_profile.py +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/network_profile.py @@ -18,7 +18,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.endpoint_test_results.models.ethernet_profile import EthernetProfile +from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_ethernet_profile import EndpointTestEthernetProfile from thousandeyes_sdk.endpoint_test_results.models.interface_hardware_type import InterfaceHardwareType from thousandeyes_sdk.endpoint_test_results.models.network_interface import NetworkInterface from thousandeyes_sdk.endpoint_test_results.models.network_proxy_profile import NetworkProxyProfile @@ -42,7 +42,7 @@ class NetworkProfile(BaseModel): gateway: Optional[StrictStr] = Field(default=None, description="Network gateway address.") wireless_profile: Optional[NetworkWirelessProfile] = Field(default=None, alias="wirelessProfile") proxy_profile: Optional[NetworkProxyProfile] = Field(default=None, alias="proxyProfile") - ethernet_profile: Optional[EthernetProfile] = Field(default=None, alias="ethernetProfile") + ethernet_profile: Optional[EndpointTestEthernetProfile] = Field(default=None, alias="ethernetProfile") previous_interface: Optional[NetworkInterface] = Field(default=None, alias="previousInterface") __properties: ClassVar[List[str]] = ["ipAddress", "subnetMask", "publicIpAddress", "localPrefix", "publicIpRange", "dnsServers", "hardwareType", "interfaceName", "error", "gateway", "wirelessProfile", "proxyProfile", "ethernetProfile", "previousInterface"] @@ -140,7 +140,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "gateway": obj.get("gateway"), "wirelessProfile": NetworkWirelessProfile.from_dict(obj["wirelessProfile"]) if obj.get("wirelessProfile") is not None else None, "proxyProfile": NetworkProxyProfile.from_dict(obj["proxyProfile"]) if obj.get("proxyProfile") is not None else None, - "ethernetProfile": EthernetProfile.from_dict(obj["ethernetProfile"]) if obj.get("ethernetProfile") is not None else None, + "ethernetProfile": EndpointTestEthernetProfile.from_dict(obj["ethernetProfile"]) if obj.get("ethernetProfile") is not None else None, "previousInterface": NetworkInterface.from_dict(obj["previousInterface"]) if obj.get("previousInterface") is not None else None }) return _obj diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_base_endpoint_test_result.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_base_endpoint_test_result.py new file mode 100644 index 000000000..679cec515 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_base_endpoint_test_result.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.asn_details import AsnDetails +from thousandeyes_sdk.endpoint_test_results.models.network_profile import NetworkProfile +from thousandeyes_sdk.endpoint_test_results.models.system_metrics import SystemMetrics +from thousandeyes_sdk.endpoint_test_results.models.target_profile import TargetProfile +from thousandeyes_sdk.endpoint_test_results.models.vpn_profile import VpnProfile +from typing import Optional, Set +from typing_extensions import Self + +class PathVisBaseEndpointTestResult(BaseModel): + """ + PathVisBaseEndpointTestResult + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + test_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint test.", alias="testId") + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of target server.", alias="serverIp") + network_profile: Optional[NetworkProfile] = Field(default=None, alias="networkProfile") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + original_target_profile: Optional[TargetProfile] = Field(default=None, alias="originalTargetProfile") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + asn_details: Optional[AsnDetails] = Field(default=None, alias="asnDetails") + server: Optional[StrictStr] = Field(default=None, description="Target server, including port.") + source_ip: Optional[StrictStr] = Field(default=None, description="IP address of source endpoint agent.", alias="sourceIp") + source_prefix: Optional[StrictStr] = Field(default=None, description="IP prefix of source endpoint agent.", alias="sourcePrefix") + __properties: ClassVar[List[str]] = ["aid", "testId", "agentId", "roundId", "serverIp", "networkProfile", "systemMetrics", "originalTargetProfile", "vpnProfile", "asnDetails", "server", "sourceIp", "sourcePrefix"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PathVisBaseEndpointTestResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "test_id", + "agent_id", + "round_id", + "server_ip", + "server", + "source_ip", + "source_prefix", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of network_profile + if self.network_profile: + _dict['networkProfile'] = self.network_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of original_target_profile + if self.original_target_profile: + _dict['originalTargetProfile'] = self.original_target_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of asn_details + if self.asn_details: + _dict['asnDetails'] = self.asn_details.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PathVisBaseEndpointTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "testId": obj.get("testId"), + "agentId": obj.get("agentId"), + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "networkProfile": NetworkProfile.from_dict(obj["networkProfile"]) if obj.get("networkProfile") is not None else None, + "systemMetrics": SystemMetrics.from_dict(obj["systemMetrics"]) if obj.get("systemMetrics") is not None else None, + "originalTargetProfile": TargetProfile.from_dict(obj["originalTargetProfile"]) if obj.get("originalTargetProfile") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj["vpnProfile"]) if obj.get("vpnProfile") is not None else None, + "asnDetails": AsnDetails.from_dict(obj["asnDetails"]) if obj.get("asnDetails") is not None else None, + "server": obj.get("server"), + "sourceIp": obj.get("sourceIp"), + "sourcePrefix": obj.get("sourcePrefix") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_dynamic_endpoint_test_result.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_dynamic_endpoint_test_result.py new file mode 100644 index 000000000..e6a3d25dd --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_dynamic_endpoint_test_result.py @@ -0,0 +1,181 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.asn_details import AsnDetails +from thousandeyes_sdk.endpoint_test_results.models.dynamic_endpoint_test_webex import DynamicEndpointTestWebex +from thousandeyes_sdk.endpoint_test_results.models.endpoint_path_vis_route import EndpointPathVisRoute +from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_result_protocol import EndpointTestResultProtocol +from thousandeyes_sdk.endpoint_test_results.models.network_profile import NetworkProfile +from thousandeyes_sdk.endpoint_test_results.models.system_metrics import SystemMetrics +from thousandeyes_sdk.endpoint_test_results.models.target_profile import TargetProfile +from thousandeyes_sdk.endpoint_test_results.models.test_probe_mode_response import TestProbeModeResponse +from thousandeyes_sdk.endpoint_test_results.models.udp_probe_mode_response import UdpProbeModeResponse +from thousandeyes_sdk.endpoint_test_results.models.vpn_profile import VpnProfile +from typing import Optional, Set +from typing_extensions import Self + +class PathVisDetailDynamicEndpointTestResult(BaseModel): + """ + PathVisDetailDynamicEndpointTestResult + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + test_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint test.", alias="testId") + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of target server.", alias="serverIp") + network_profile: Optional[NetworkProfile] = Field(default=None, alias="networkProfile") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + original_target_profile: Optional[TargetProfile] = Field(default=None, alias="originalTargetProfile") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + asn_details: Optional[AsnDetails] = Field(default=None, alias="asnDetails") + server: Optional[StrictStr] = Field(default=None, description="Target server, including port.") + source_ip: Optional[StrictStr] = Field(default=None, description="IP address of source endpoint agent.", alias="sourceIp") + source_prefix: Optional[StrictStr] = Field(default=None, description="IP prefix of source endpoint agent.", alias="sourcePrefix") + path_traces: Optional[List[EndpointPathVisRoute]] = Field(default=None, description="Shows iterations of path trace, with each iteration specified by a pathId.", alias="pathTraces") + vpn_path_traces: Optional[List[EndpointPathVisRoute]] = Field(default=None, description="Shows iterations of the VPN path trace, with each iteration specified by a pathId.", alias="vpnPathTraces") + application: Optional[StrictStr] = Field(default=None, description="Which supported application to monitor, can be one of `webex`, `zoom`, `microsoft-teams`.") + protocol: Optional[EndpointTestResultProtocol] = None + tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") + udp_probe_mode: Optional[UdpProbeModeResponse] = Field(default=None, alias="udpProbeMode") + webex: Optional[DynamicEndpointTestWebex] = None + __properties: ClassVar[List[str]] = ["aid", "testId", "agentId", "roundId", "serverIp", "networkProfile", "systemMetrics", "originalTargetProfile", "vpnProfile", "asnDetails", "server", "sourceIp", "sourcePrefix", "pathTraces", "vpnPathTraces", "application", "protocol", "tcpProbeMode", "udpProbeMode", "webex"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PathVisDetailDynamicEndpointTestResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "test_id", + "agent_id", + "round_id", + "server_ip", + "server", + "source_ip", + "source_prefix", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of network_profile + if self.network_profile: + _dict['networkProfile'] = self.network_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of original_target_profile + if self.original_target_profile: + _dict['originalTargetProfile'] = self.original_target_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of asn_details + if self.asn_details: + _dict['asnDetails'] = self.asn_details.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in path_traces (list) + _items = [] + if self.path_traces: + for _item in self.path_traces: + if _item: + _items.append(_item.to_dict()) + _dict['pathTraces'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in vpn_path_traces (list) + _items = [] + if self.vpn_path_traces: + for _item in self.vpn_path_traces: + if _item: + _items.append(_item.to_dict()) + _dict['vpnPathTraces'] = _items + # override the default output from pydantic by calling `to_dict()` of webex + if self.webex: + _dict['webex'] = self.webex.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PathVisDetailDynamicEndpointTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "testId": obj.get("testId"), + "agentId": obj.get("agentId"), + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "networkProfile": NetworkProfile.from_dict(obj["networkProfile"]) if obj.get("networkProfile") is not None else None, + "systemMetrics": SystemMetrics.from_dict(obj["systemMetrics"]) if obj.get("systemMetrics") is not None else None, + "originalTargetProfile": TargetProfile.from_dict(obj["originalTargetProfile"]) if obj.get("originalTargetProfile") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj["vpnProfile"]) if obj.get("vpnProfile") is not None else None, + "asnDetails": AsnDetails.from_dict(obj["asnDetails"]) if obj.get("asnDetails") is not None else None, + "server": obj.get("server"), + "sourceIp": obj.get("sourceIp"), + "sourcePrefix": obj.get("sourcePrefix"), + "pathTraces": [EndpointPathVisRoute.from_dict(_item) for _item in obj["pathTraces"]] if obj.get("pathTraces") is not None else None, + "vpnPathTraces": [EndpointPathVisRoute.from_dict(_item) for _item in obj["vpnPathTraces"]] if obj.get("vpnPathTraces") is not None else None, + "application": obj.get("application"), + "protocol": obj.get("protocol"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "udpProbeMode": obj.get("udpProbeMode"), + "webex": DynamicEndpointTestWebex.from_dict(obj["webex"]) if obj.get("webex") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_dynamic_endpoint_test_results.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_dynamic_endpoint_test_results.py new file mode 100644 index 000000000..fbfae6694 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_dynamic_endpoint_test_results.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.dynamic_test import DynamicTest +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_dynamic_endpoint_test_result import PathVisDetailDynamicEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class PathVisDetailDynamicEndpointTestResults(BaseModel): + """ + PathVisDetailDynamicEndpointTestResults + """ # noqa: E501 + results: Optional[List[PathVisDetailDynamicEndpointTestResult]] = None + test: Optional[DynamicTest] = None + links: Optional[SelfLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PathVisDetailDynamicEndpointTestResults from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PathVisDetailDynamicEndpointTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PathVisDetailDynamicEndpointTestResult.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "test": DynamicTest.from_dict(obj["test"]) if obj.get("test") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_endpoint_test_result.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_endpoint_test_result.py new file mode 100644 index 000000000..fec9776be --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_endpoint_test_result.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.asn_details import AsnDetails +from thousandeyes_sdk.endpoint_test_results.models.endpoint_path_vis_route import EndpointPathVisRoute +from thousandeyes_sdk.endpoint_test_results.models.network_profile import NetworkProfile +from thousandeyes_sdk.endpoint_test_results.models.system_metrics import SystemMetrics +from thousandeyes_sdk.endpoint_test_results.models.target_profile import TargetProfile +from thousandeyes_sdk.endpoint_test_results.models.vpn_profile import VpnProfile +from typing import Optional, Set +from typing_extensions import Self + +class PathVisDetailEndpointTestResult(BaseModel): + """ + PathVisDetailEndpointTestResult + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + test_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint test.", alias="testId") + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of target server.", alias="serverIp") + network_profile: Optional[NetworkProfile] = Field(default=None, alias="networkProfile") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + original_target_profile: Optional[TargetProfile] = Field(default=None, alias="originalTargetProfile") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + asn_details: Optional[AsnDetails] = Field(default=None, alias="asnDetails") + server: Optional[StrictStr] = Field(default=None, description="Target server, including port.") + source_ip: Optional[StrictStr] = Field(default=None, description="IP address of source endpoint agent.", alias="sourceIp") + source_prefix: Optional[StrictStr] = Field(default=None, description="IP prefix of source endpoint agent.", alias="sourcePrefix") + path_traces: Optional[List[EndpointPathVisRoute]] = Field(default=None, description="Shows iterations of path trace, with each iteration specified by a pathId.", alias="pathTraces") + vpn_path_traces: Optional[List[EndpointPathVisRoute]] = Field(default=None, description="Shows iterations of the VPN path trace, with each iteration specified by a pathId.", alias="vpnPathTraces") + __properties: ClassVar[List[str]] = ["aid", "testId", "agentId", "roundId", "serverIp", "networkProfile", "systemMetrics", "originalTargetProfile", "vpnProfile", "asnDetails", "server", "sourceIp", "sourcePrefix", "pathTraces", "vpnPathTraces"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PathVisDetailEndpointTestResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "test_id", + "agent_id", + "round_id", + "server_ip", + "server", + "source_ip", + "source_prefix", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of network_profile + if self.network_profile: + _dict['networkProfile'] = self.network_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of original_target_profile + if self.original_target_profile: + _dict['originalTargetProfile'] = self.original_target_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of asn_details + if self.asn_details: + _dict['asnDetails'] = self.asn_details.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in path_traces (list) + _items = [] + if self.path_traces: + for _item in self.path_traces: + if _item: + _items.append(_item.to_dict()) + _dict['pathTraces'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in vpn_path_traces (list) + _items = [] + if self.vpn_path_traces: + for _item in self.vpn_path_traces: + if _item: + _items.append(_item.to_dict()) + _dict['vpnPathTraces'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PathVisDetailEndpointTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "testId": obj.get("testId"), + "agentId": obj.get("agentId"), + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "networkProfile": NetworkProfile.from_dict(obj["networkProfile"]) if obj.get("networkProfile") is not None else None, + "systemMetrics": SystemMetrics.from_dict(obj["systemMetrics"]) if obj.get("systemMetrics") is not None else None, + "originalTargetProfile": TargetProfile.from_dict(obj["originalTargetProfile"]) if obj.get("originalTargetProfile") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj["vpnProfile"]) if obj.get("vpnProfile") is not None else None, + "asnDetails": AsnDetails.from_dict(obj["asnDetails"]) if obj.get("asnDetails") is not None else None, + "server": obj.get("server"), + "sourceIp": obj.get("sourceIp"), + "sourcePrefix": obj.get("sourcePrefix"), + "pathTraces": [EndpointPathVisRoute.from_dict(_item) for _item in obj["pathTraces"]] if obj.get("pathTraces") is not None else None, + "vpnPathTraces": [EndpointPathVisRoute.from_dict(_item) for _item in obj["vpnPathTraces"]] if obj.get("vpnPathTraces") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_endpoint_test_results.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_endpoint_test_results.py new file mode 100644 index 000000000..190156eb3 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_detail_endpoint_test_results.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.endpoint_scheduled_test import EndpointScheduledTest +from thousandeyes_sdk.endpoint_test_results.models.path_vis_detail_endpoint_test_result import PathVisDetailEndpointTestResult +from thousandeyes_sdk.endpoint_test_results.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class PathVisDetailEndpointTestResults(BaseModel): + """ + PathVisDetailEndpointTestResults + """ # noqa: E501 + results: Optional[List[PathVisDetailEndpointTestResult]] = None + test: Optional[EndpointScheduledTest] = None + links: Optional[SelfLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PathVisDetailEndpointTestResults from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PathVisDetailEndpointTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PathVisDetailEndpointTestResult.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "test": EndpointScheduledTest.from_dict(obj["test"]) if obj.get("test") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_dynamic_endpoint_test_result.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_dynamic_endpoint_test_result.py new file mode 100644 index 000000000..19094d7da --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_dynamic_endpoint_test_result.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.asn_details import AsnDetails +from thousandeyes_sdk.endpoint_test_results.models.dynamic_endpoint_test_webex import DynamicEndpointTestWebex +from thousandeyes_sdk.endpoint_test_results.models.endpoint_path_trace import EndpointPathTrace +from thousandeyes_sdk.endpoint_test_results.models.endpoint_test_result_protocol import EndpointTestResultProtocol +from thousandeyes_sdk.endpoint_test_results.models.network_profile import NetworkProfile +from thousandeyes_sdk.endpoint_test_results.models.system_metrics import SystemMetrics +from thousandeyes_sdk.endpoint_test_results.models.target_profile import TargetProfile +from thousandeyes_sdk.endpoint_test_results.models.test_probe_mode_response import TestProbeModeResponse +from thousandeyes_sdk.endpoint_test_results.models.udp_probe_mode_response import UdpProbeModeResponse +from thousandeyes_sdk.endpoint_test_results.models.vpn_profile import VpnProfile +from typing import Optional, Set +from typing_extensions import Self + +class PathVisDynamicEndpointTestResult(BaseModel): + """ + PathVisDynamicEndpointTestResult + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + test_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint test.", alias="testId") + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of target server.", alias="serverIp") + network_profile: Optional[NetworkProfile] = Field(default=None, alias="networkProfile") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + original_target_profile: Optional[TargetProfile] = Field(default=None, alias="originalTargetProfile") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + asn_details: Optional[AsnDetails] = Field(default=None, alias="asnDetails") + server: Optional[StrictStr] = Field(default=None, description="Target server, including port.") + source_ip: Optional[StrictStr] = Field(default=None, description="IP address of source endpoint agent.", alias="sourceIp") + source_prefix: Optional[StrictStr] = Field(default=None, description="IP prefix of source endpoint agent.", alias="sourcePrefix") + application: Optional[StrictStr] = Field(default=None, description="Which supported application to monitor, can be one of `webex`, `zoom`, `microsoft-teams`.") + protocol: Optional[EndpointTestResultProtocol] = None + tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") + udp_probe_mode: Optional[UdpProbeModeResponse] = Field(default=None, alias="udpProbeMode") + webex: Optional[DynamicEndpointTestWebex] = None + location: Optional[StrictStr] = Field(default=None, description="Geographic location of the path visualization.") + path_traces: Optional[List[EndpointPathTrace]] = Field(default=None, description="Shows an iteration of path trace, with each iteration specified by a pathId.", alias="pathTraces") + __properties: ClassVar[List[str]] = ["aid", "testId", "agentId", "roundId", "serverIp", "networkProfile", "systemMetrics", "originalTargetProfile", "vpnProfile", "asnDetails", "server", "sourceIp", "sourcePrefix", "application", "protocol", "tcpProbeMode", "udpProbeMode", "webex", "location", "pathTraces"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PathVisDynamicEndpointTestResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "test_id", + "agent_id", + "round_id", + "server_ip", + "server", + "source_ip", + "source_prefix", + "location", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of network_profile + if self.network_profile: + _dict['networkProfile'] = self.network_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of original_target_profile + if self.original_target_profile: + _dict['originalTargetProfile'] = self.original_target_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of asn_details + if self.asn_details: + _dict['asnDetails'] = self.asn_details.to_dict() + # override the default output from pydantic by calling `to_dict()` of webex + if self.webex: + _dict['webex'] = self.webex.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in path_traces (list) + _items = [] + if self.path_traces: + for _item in self.path_traces: + if _item: + _items.append(_item.to_dict()) + _dict['pathTraces'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PathVisDynamicEndpointTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "testId": obj.get("testId"), + "agentId": obj.get("agentId"), + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "networkProfile": NetworkProfile.from_dict(obj["networkProfile"]) if obj.get("networkProfile") is not None else None, + "systemMetrics": SystemMetrics.from_dict(obj["systemMetrics"]) if obj.get("systemMetrics") is not None else None, + "originalTargetProfile": TargetProfile.from_dict(obj["originalTargetProfile"]) if obj.get("originalTargetProfile") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj["vpnProfile"]) if obj.get("vpnProfile") is not None else None, + "asnDetails": AsnDetails.from_dict(obj["asnDetails"]) if obj.get("asnDetails") is not None else None, + "server": obj.get("server"), + "sourceIp": obj.get("sourceIp"), + "sourcePrefix": obj.get("sourcePrefix"), + "application": obj.get("application"), + "protocol": obj.get("protocol"), + "tcpProbeMode": obj.get("tcpProbeMode"), + "udpProbeMode": obj.get("udpProbeMode"), + "webex": DynamicEndpointTestWebex.from_dict(obj["webex"]) if obj.get("webex") is not None else None, + "location": obj.get("location"), + "pathTraces": [EndpointPathTrace.from_dict(_item) for _item in obj["pathTraces"]] if obj.get("pathTraces") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_dynamic_endpoint_test_results.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_dynamic_endpoint_test_results.py new file mode 100644 index 000000000..ad3979883 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_dynamic_endpoint_test_results.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.dynamic_test import DynamicTest +from thousandeyes_sdk.endpoint_test_results.models.pagination_next_and_self_link import PaginationNextAndSelfLink +from thousandeyes_sdk.endpoint_test_results.models.path_vis_dynamic_endpoint_test_result import PathVisDynamicEndpointTestResult +from typing import Optional, Set +from typing_extensions import Self + +class PathVisDynamicEndpointTestResults(BaseModel): + """ + PathVisDynamicEndpointTestResults + """ # noqa: E501 + results: Optional[List[PathVisDynamicEndpointTestResult]] = None + test: Optional[DynamicTest] = None + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + total_hits: Optional[StrictInt] = Field(default=None, description="Total number of measurements that match the search criteria", alias="totalHits") + links: Optional[PaginationNextAndSelfLink] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "startDate", "endDate", "totalHits", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PathVisDynamicEndpointTestResults from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "start_date", + "end_date", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PathVisDynamicEndpointTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PathVisDynamicEndpointTestResult.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "test": DynamicTest.from_dict(obj["test"]) if obj.get("test") is not None else None, + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "totalHits": obj.get("totalHits"), + "_links": PaginationNextAndSelfLink.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_endpoint_test_result.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_endpoint_test_result.py new file mode 100644 index 000000000..3a078f85f --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_endpoint_test_result.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.asn_details import AsnDetails +from thousandeyes_sdk.endpoint_test_results.models.endpoint_path_trace import EndpointPathTrace +from thousandeyes_sdk.endpoint_test_results.models.network_profile import NetworkProfile +from thousandeyes_sdk.endpoint_test_results.models.system_metrics import SystemMetrics +from thousandeyes_sdk.endpoint_test_results.models.target_profile import TargetProfile +from thousandeyes_sdk.endpoint_test_results.models.vpn_profile import VpnProfile +from typing import Optional, Set +from typing_extensions import Self + +class PathVisEndpointTestResult(BaseModel): + """ + PathVisEndpointTestResult + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + test_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint test.", alias="testId") + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + server_ip: Optional[StrictStr] = Field(default=None, description="IP address of target server.", alias="serverIp") + network_profile: Optional[NetworkProfile] = Field(default=None, alias="networkProfile") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + original_target_profile: Optional[TargetProfile] = Field(default=None, alias="originalTargetProfile") + vpn_profile: Optional[VpnProfile] = Field(default=None, alias="vpnProfile") + asn_details: Optional[AsnDetails] = Field(default=None, alias="asnDetails") + server: Optional[StrictStr] = Field(default=None, description="Target server, including port.") + source_ip: Optional[StrictStr] = Field(default=None, description="IP address of source endpoint agent.", alias="sourceIp") + source_prefix: Optional[StrictStr] = Field(default=None, description="IP prefix of source endpoint agent.", alias="sourcePrefix") + location: Optional[StrictStr] = Field(default=None, description="Geographic location of the path visualization.") + path_traces: Optional[List[EndpointPathTrace]] = Field(default=None, description="Shows an iteration of path trace, with each iteration specified by a pathId.", alias="pathTraces") + __properties: ClassVar[List[str]] = ["aid", "testId", "agentId", "roundId", "serverIp", "networkProfile", "systemMetrics", "originalTargetProfile", "vpnProfile", "asnDetails", "server", "sourceIp", "sourcePrefix", "location", "pathTraces"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PathVisEndpointTestResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "test_id", + "agent_id", + "round_id", + "server_ip", + "server", + "source_ip", + "source_prefix", + "location", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of network_profile + if self.network_profile: + _dict['networkProfile'] = self.network_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of original_target_profile + if self.original_target_profile: + _dict['originalTargetProfile'] = self.original_target_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_profile + if self.vpn_profile: + _dict['vpnProfile'] = self.vpn_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of asn_details + if self.asn_details: + _dict['asnDetails'] = self.asn_details.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in path_traces (list) + _items = [] + if self.path_traces: + for _item in self.path_traces: + if _item: + _items.append(_item.to_dict()) + _dict['pathTraces'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PathVisEndpointTestResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "testId": obj.get("testId"), + "agentId": obj.get("agentId"), + "roundId": obj.get("roundId"), + "serverIp": obj.get("serverIp"), + "networkProfile": NetworkProfile.from_dict(obj["networkProfile"]) if obj.get("networkProfile") is not None else None, + "systemMetrics": SystemMetrics.from_dict(obj["systemMetrics"]) if obj.get("systemMetrics") is not None else None, + "originalTargetProfile": TargetProfile.from_dict(obj["originalTargetProfile"]) if obj.get("originalTargetProfile") is not None else None, + "vpnProfile": VpnProfile.from_dict(obj["vpnProfile"]) if obj.get("vpnProfile") is not None else None, + "asnDetails": AsnDetails.from_dict(obj["asnDetails"]) if obj.get("asnDetails") is not None else None, + "server": obj.get("server"), + "sourceIp": obj.get("sourceIp"), + "sourcePrefix": obj.get("sourcePrefix"), + "location": obj.get("location"), + "pathTraces": [EndpointPathTrace.from_dict(_item) for _item in obj["pathTraces"]] if obj.get("pathTraces") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_endpoint_test_results.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_endpoint_test_results.py new file mode 100644 index 000000000..2b87ea432 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/path_vis_endpoint_test_results.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.endpoint_scheduled_test import EndpointScheduledTest +from thousandeyes_sdk.endpoint_test_results.models.pagination_next_and_self_link import PaginationNextAndSelfLink +from thousandeyes_sdk.endpoint_test_results.models.path_vis_endpoint_test_result import PathVisEndpointTestResult +from typing import Optional, Set +from typing_extensions import Self + +class PathVisEndpointTestResults(BaseModel): + """ + PathVisEndpointTestResults + """ # noqa: E501 + results: Optional[List[PathVisEndpointTestResult]] = None + test: Optional[EndpointScheduledTest] = None + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + links: Optional[PaginationNextAndSelfLink] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "test", "startDate", "endDate", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PathVisEndpointTestResults from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "start_date", + "end_date", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PathVisEndpointTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PathVisEndpointTestResult.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "test": EndpointScheduledTest.from_dict(obj["test"]) if obj.get("test") is not None else None, + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "_links": PaginationNextAndSelfLink.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/platform.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/platform.py index dc3be4f69..a12cab2cf 100644 --- a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/platform.py +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/platform.py @@ -19,13 +19,16 @@ class Platform(str, Enum): """ - OS platform types + OS platform types. Platform \"linux\" was recently renamed to \"roomos\". """ """ allowed enum values """ WINDOWS = 'windows' + ROOMOS = 'roomos' + PHONEOS = 'phoneos' + ELUX = 'elux' LINUX = 'linux' MAC = 'mac' diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test.py new file mode 100644 index 000000000..73e7653ad --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class RealUserEndpointTest(BaseModel): + """ + RealUserEndpointTest + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + committed: Optional[datetime] = Field(default=None, description="UTC date when endpoint real user test was committed to the controller (ISO date-time format).") + var_date: Optional[datetime] = Field(default=None, description="UTC date when endpoint real user test took place (ISO date-time format).", alias="date") + experience_score: Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=None, description="Score rating a user’s experience when loading a particular page, from 0 (the worst) to 1 (the best). [More details](https://docs.thousandeyes.com/product-documentation/end-user-monitoring/viewing-data/endpoint-agent-views-reference#user-experience-score).", alias="experienceScore") + number_of_pages: Optional[StrictInt] = Field(default=None, description="Number of web pages visited on target website.", alias="numberOfPages") + organization_name: Optional[StrictStr] = Field(default=None, description="Name of the AS organization `sourceAddress` belongs to.", alias="organizationName") + port: Optional[StrictInt] = Field(default=None, description="Port used to visit target website.") + protocol: Optional[StrictStr] = Field(default=None, description="Protocol used to visit target website.") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + source_address: Optional[StrictStr] = Field(default=None, description="Public IP address of the endpoint agent during the session.", alias="sourceAddress") + id: Optional[StrictStr] = Field(default=None, description="Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID.") + visited_site: Optional[StrictStr] = Field(default=None, description="Domain used to visit target website.", alias="visitedSite") + page_id: Optional[StrictStr] = Field(default=None, description="Web page ID. The page ID is unique only within an endpoint real user test.", alias="pageId") + __properties: ClassVar[List[str]] = ["agentId", "committed", "date", "experienceScore", "numberOfPages", "organizationName", "port", "protocol", "roundId", "sourceAddress", "id", "visitedSite", "pageId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RealUserEndpointTest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "agent_id", + "committed", + "var_date", + "experience_score", + "number_of_pages", + "organization_name", + "port", + "protocol", + "round_id", + "source_address", + "id", + "visited_site", + "page_id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RealUserEndpointTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "committed": obj.get("committed"), + "date": obj.get("date"), + "experienceScore": obj.get("experienceScore"), + "numberOfPages": obj.get("numberOfPages"), + "organizationName": obj.get("organizationName"), + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "roundId": obj.get("roundId"), + "sourceAddress": obj.get("sourceAddress"), + "id": obj.get("id"), + "visitedSite": obj.get("visitedSite"), + "pageId": obj.get("pageId") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_base.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_base.py new file mode 100644 index 000000000..2d0dc143e --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_base.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class RealUserEndpointTestBase(BaseModel): + """ + RealUserEndpointTestBase + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + committed: Optional[datetime] = Field(default=None, description="UTC date when endpoint real user test was committed to the controller (ISO date-time format).") + var_date: Optional[datetime] = Field(default=None, description="UTC date when endpoint real user test took place (ISO date-time format).", alias="date") + experience_score: Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=None, description="Score rating a user’s experience when loading a particular page, from 0 (the worst) to 1 (the best). [More details](https://docs.thousandeyes.com/product-documentation/end-user-monitoring/viewing-data/endpoint-agent-views-reference#user-experience-score).", alias="experienceScore") + number_of_pages: Optional[StrictInt] = Field(default=None, description="Number of web pages visited on target website.", alias="numberOfPages") + organization_name: Optional[StrictStr] = Field(default=None, description="Name of the AS organization `sourceAddress` belongs to.", alias="organizationName") + port: Optional[StrictInt] = Field(default=None, description="Port used to visit target website.") + protocol: Optional[StrictStr] = Field(default=None, description="Protocol used to visit target website.") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + source_address: Optional[StrictStr] = Field(default=None, description="Public IP address of the endpoint agent during the session.", alias="sourceAddress") + id: Optional[StrictStr] = Field(default=None, description="Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID.") + visited_site: Optional[StrictStr] = Field(default=None, description="Domain used to visit target website.", alias="visitedSite") + __properties: ClassVar[List[str]] = ["agentId", "committed", "date", "experienceScore", "numberOfPages", "organizationName", "port", "protocol", "roundId", "sourceAddress", "id", "visitedSite"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RealUserEndpointTestBase from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "agent_id", + "committed", + "var_date", + "experience_score", + "number_of_pages", + "organization_name", + "port", + "protocol", + "round_id", + "source_address", + "id", + "visited_site", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RealUserEndpointTestBase from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "committed": obj.get("committed"), + "date": obj.get("date"), + "experienceScore": obj.get("experienceScore"), + "numberOfPages": obj.get("numberOfPages"), + "organizationName": obj.get("organizationName"), + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "roundId": obj.get("roundId"), + "sourceAddress": obj.get("sourceAddress"), + "id": obj.get("id"), + "visitedSite": obj.get("visitedSite") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_coordinates.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_coordinates.py new file mode 100644 index 000000000..bf994543d --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_coordinates.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class RealUserEndpointTestCoordinates(BaseModel): + """ + Contains approximate GPS location of the endpoint agent, based on endpoint agent’s public IP address. + """ # noqa: E501 + latitude: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Numeric representations of GPS coordinates.") + location: Optional[StrictStr] = Field(default=None, description="Represents named geographical location.") + longitude: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Numeric representations of GPS coordinates.") + __properties: ClassVar[List[str]] = ["latitude", "location", "longitude"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RealUserEndpointTestCoordinates from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "latitude", + "location", + "longitude", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RealUserEndpointTestCoordinates from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "latitude": obj.get("latitude"), + "location": obj.get("location"), + "longitude": obj.get("longitude") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_detail.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_detail.py new file mode 100644 index 000000000..37ed3ec3d --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_detail.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from thousandeyes_sdk.endpoint_test_results.models.endpoint_browser import EndpointBrowser +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_coordinates import RealUserEndpointTestCoordinates +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_network import RealUserEndpointTestNetwork +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page import RealUserEndpointTestPage +from typing import Optional, Set +from typing_extensions import Self + +class RealUserEndpointTestDetail(BaseModel): + """ + RealUserEndpointTestDetail + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + committed: Optional[datetime] = Field(default=None, description="UTC date when endpoint real user test was committed to the controller (ISO date-time format).") + var_date: Optional[datetime] = Field(default=None, description="UTC date when endpoint real user test took place (ISO date-time format).", alias="date") + experience_score: Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=None, description="Score rating a user’s experience when loading a particular page, from 0 (the worst) to 1 (the best). [More details](https://docs.thousandeyes.com/product-documentation/end-user-monitoring/viewing-data/endpoint-agent-views-reference#user-experience-score).", alias="experienceScore") + number_of_pages: Optional[StrictInt] = Field(default=None, description="Number of web pages visited on target website.", alias="numberOfPages") + organization_name: Optional[StrictStr] = Field(default=None, description="Name of the AS organization `sourceAddress` belongs to.", alias="organizationName") + port: Optional[StrictInt] = Field(default=None, description="Port used to visit target website.") + protocol: Optional[StrictStr] = Field(default=None, description="Protocol used to visit target website.") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + source_address: Optional[StrictStr] = Field(default=None, description="Public IP address of the endpoint agent during the session.", alias="sourceAddress") + id: Optional[StrictStr] = Field(default=None, description="Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID.") + visited_site: Optional[StrictStr] = Field(default=None, description="Domain used to visit target website.", alias="visitedSite") + browser: Optional[EndpointBrowser] = None + coordinates: Optional[RealUserEndpointTestCoordinates] = None + pages: Optional[List[RealUserEndpointTestPage]] = Field(default=None, description="Web site base domain visited during the session.") + network: Optional[RealUserEndpointTestNetwork] = None + __properties: ClassVar[List[str]] = ["agentId", "committed", "date", "experienceScore", "numberOfPages", "organizationName", "port", "protocol", "roundId", "sourceAddress", "id", "visitedSite", "browser", "coordinates", "pages", "network"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RealUserEndpointTestDetail from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "agent_id", + "committed", + "var_date", + "experience_score", + "number_of_pages", + "organization_name", + "port", + "protocol", + "round_id", + "source_address", + "id", + "visited_site", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of browser + if self.browser: + _dict['browser'] = self.browser.to_dict() + # override the default output from pydantic by calling `to_dict()` of coordinates + if self.coordinates: + _dict['coordinates'] = self.coordinates.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in pages (list) + _items = [] + if self.pages: + for _item in self.pages: + if _item: + _items.append(_item.to_dict()) + _dict['pages'] = _items + # override the default output from pydantic by calling `to_dict()` of network + if self.network: + _dict['network'] = self.network.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RealUserEndpointTestDetail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "committed": obj.get("committed"), + "date": obj.get("date"), + "experienceScore": obj.get("experienceScore"), + "numberOfPages": obj.get("numberOfPages"), + "organizationName": obj.get("organizationName"), + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "roundId": obj.get("roundId"), + "sourceAddress": obj.get("sourceAddress"), + "id": obj.get("id"), + "visitedSite": obj.get("visitedSite"), + "browser": EndpointBrowser.from_dict(obj["browser"]) if obj.get("browser") is not None else None, + "coordinates": RealUserEndpointTestCoordinates.from_dict(obj["coordinates"]) if obj.get("coordinates") is not None else None, + "pages": [RealUserEndpointTestPage.from_dict(_item) for _item in obj["pages"]] if obj.get("pages") is not None else None, + "network": RealUserEndpointTestNetwork.from_dict(obj["network"]) if obj.get("network") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_detail_results.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_detail_results.py new file mode 100644 index 000000000..3e70a7f93 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_detail_results.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_detail import RealUserEndpointTestDetail +from thousandeyes_sdk.endpoint_test_results.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class RealUserEndpointTestDetailResults(BaseModel): + """ + RealUserEndpointTestDetailResults + """ # noqa: E501 + results: Optional[List[RealUserEndpointTestDetail]] = None + links: Optional[SelfLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RealUserEndpointTestDetailResults from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RealUserEndpointTestDetailResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [RealUserEndpointTestDetail.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_network.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_network.py new file mode 100644 index 000000000..dd2ec52ce --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_network.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from thousandeyes_sdk.endpoint_test_results.models.gateway_network_ping import GatewayNetworkPing +from thousandeyes_sdk.endpoint_test_results.models.network_profile import NetworkProfile +from thousandeyes_sdk.endpoint_test_results.models.system_metrics import SystemMetrics +from thousandeyes_sdk.endpoint_test_results.models.target_network_ping import TargetNetworkPing +from thousandeyes_sdk.endpoint_test_results.models.target_traceroute import TargetTraceroute +from thousandeyes_sdk.endpoint_test_results.models.vpn_network_ping import VpnNetworkPing +from thousandeyes_sdk.endpoint_test_results.models.vpn_traceroute import VpnTraceroute +from typing import Optional, Set +from typing_extensions import Self + +class RealUserEndpointTestNetwork(BaseModel): + """ + Contains details about network profile and conditions during session. + """ # noqa: E501 + network_profile: Optional[NetworkProfile] = Field(default=None, alias="networkProfile") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + gateway_ping: Optional[GatewayNetworkPing] = Field(default=None, alias="gatewayPing") + ping: Optional[TargetNetworkPing] = None + traceroute: Optional[TargetTraceroute] = None + connect_rtt: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Represents the number of milliseconds required to establish TCP connectivity with the target.", alias="connectRtt") + is_icmp_blocked: Optional[StrictBool] = Field(default=None, description="Set to `true` if network target is blocking ICMP echo (ping) queries.", alias="isIcmpBlocked") + errors: Optional[List[StrictStr]] = Field(default=None, description="Array of string representing possible network errors.") + vpn_ping: Optional[VpnNetworkPing] = Field(default=None, alias="vpnPing") + vpn_traceroute: Optional[VpnTraceroute] = Field(default=None, alias="vpnTraceroute") + __properties: ClassVar[List[str]] = ["networkProfile", "systemMetrics", "gatewayPing", "ping", "traceroute", "connectRtt", "isIcmpBlocked", "errors", "vpnPing", "vpnTraceroute"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RealUserEndpointTestNetwork from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "connect_rtt", + "is_icmp_blocked", + "errors", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of network_profile + if self.network_profile: + _dict['networkProfile'] = self.network_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + # override the default output from pydantic by calling `to_dict()` of gateway_ping + if self.gateway_ping: + _dict['gatewayPing'] = self.gateway_ping.to_dict() + # override the default output from pydantic by calling `to_dict()` of ping + if self.ping: + _dict['ping'] = self.ping.to_dict() + # override the default output from pydantic by calling `to_dict()` of traceroute + if self.traceroute: + _dict['traceroute'] = self.traceroute.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_ping + if self.vpn_ping: + _dict['vpnPing'] = self.vpn_ping.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_traceroute + if self.vpn_traceroute: + _dict['vpnTraceroute'] = self.vpn_traceroute.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RealUserEndpointTestNetwork from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "networkProfile": NetworkProfile.from_dict(obj["networkProfile"]) if obj.get("networkProfile") is not None else None, + "systemMetrics": SystemMetrics.from_dict(obj["systemMetrics"]) if obj.get("systemMetrics") is not None else None, + "gatewayPing": GatewayNetworkPing.from_dict(obj["gatewayPing"]) if obj.get("gatewayPing") is not None else None, + "ping": TargetNetworkPing.from_dict(obj["ping"]) if obj.get("ping") is not None else None, + "traceroute": TargetTraceroute.from_dict(obj["traceroute"]) if obj.get("traceroute") is not None else None, + "connectRtt": obj.get("connectRtt"), + "isIcmpBlocked": obj.get("isIcmpBlocked"), + "errors": obj.get("errors"), + "vpnPing": VpnNetworkPing.from_dict(obj["vpnPing"]) if obj.get("vpnPing") is not None else None, + "vpnTraceroute": VpnTraceroute.from_dict(obj["vpnTraceroute"]) if obj.get("vpnTraceroute") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_network_result.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_network_result.py new file mode 100644 index 000000000..0d80d3d21 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_network_result.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.network_metrics import NetworkMetrics +from thousandeyes_sdk.endpoint_test_results.models.system_metrics import SystemMetrics +from typing import Optional, Set +from typing_extensions import Self + +class RealUserEndpointTestNetworkResult(BaseModel): + """ + RealUserEndpointTestNetworkResult + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + var_date: Optional[datetime] = Field(default=None, description="UTC date when endpoint real user test took place (ISO date-time format).", alias="date") + id: Optional[StrictStr] = Field(default=None, description="Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID.") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + destination: Optional[NetworkMetrics] = None + vpn: Optional[NetworkMetrics] = None + proxy: Optional[NetworkMetrics] = None + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + __properties: ClassVar[List[str]] = ["agentId", "date", "id", "roundId", "destination", "vpn", "proxy", "systemMetrics"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RealUserEndpointTestNetworkResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "agent_id", + "var_date", + "id", + "round_id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of destination + if self.destination: + _dict['destination'] = self.destination.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn + if self.vpn: + _dict['vpn'] = self.vpn.to_dict() + # override the default output from pydantic by calling `to_dict()` of proxy + if self.proxy: + _dict['proxy'] = self.proxy.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RealUserEndpointTestNetworkResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "date": obj.get("date"), + "id": obj.get("id"), + "roundId": obj.get("roundId"), + "destination": NetworkMetrics.from_dict(obj["destination"]) if obj.get("destination") is not None else None, + "vpn": NetworkMetrics.from_dict(obj["vpn"]) if obj.get("vpn") is not None else None, + "proxy": NetworkMetrics.from_dict(obj["proxy"]) if obj.get("proxy") is not None else None, + "systemMetrics": SystemMetrics.from_dict(obj["systemMetrics"]) if obj.get("systemMetrics") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_network_results.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_network_results.py new file mode 100644 index 000000000..7a2911a9d --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_network_results.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.pagination_next_link import PaginationNextLink +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_network_result import RealUserEndpointTestNetworkResult +from typing import Optional, Set +from typing_extensions import Self + +class RealUserEndpointTestNetworkResults(BaseModel): + """ + RealUserEndpointTestNetworkResults + """ # noqa: E501 + results: Optional[List[RealUserEndpointTestNetworkResult]] = None + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + links: Optional[PaginationNextLink] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "startDate", "endDate", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RealUserEndpointTestNetworkResults from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "start_date", + "end_date", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RealUserEndpointTestNetworkResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [RealUserEndpointTestNetworkResult.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "_links": PaginationNextLink.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page.py new file mode 100644 index 000000000..1ed45b7ba --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_timings import RealUserEndpointTestPageTimings +from typing import Optional, Set +from typing_extensions import Self + +class RealUserEndpointTestPage(BaseModel): + """ + RealUserEndpointTestPage + """ # noqa: E501 + page_id: Optional[StrictStr] = Field(default=None, description="Web page ID. The page ID is unique only within an endpoint real user test.", alias="pageId") + page_title: Optional[StrictStr] = Field(default=None, description="Web page title.", alias="pageTitle") + page_url: Optional[StrictStr] = Field(default=None, description="Web page url", alias="pageUrl") + load_date: Optional[datetime] = Field(default=None, description="UTC date when page load started (ISO date-time format).", alias="loadDate") + response_code: Optional[StrictInt] = Field(default=None, description="HTTP response code.", alias="responseCode") + page_timings: Optional[RealUserEndpointTestPageTimings] = Field(default=None, alias="pageTimings") + __properties: ClassVar[List[str]] = ["pageId", "pageTitle", "pageUrl", "loadDate", "responseCode", "pageTimings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RealUserEndpointTestPage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "page_id", + "page_title", + "page_url", + "load_date", + "response_code", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of page_timings + if self.page_timings: + _dict['pageTimings'] = self.page_timings.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RealUserEndpointTestPage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "pageId": obj.get("pageId"), + "pageTitle": obj.get("pageTitle"), + "pageUrl": obj.get("pageUrl"), + "loadDate": obj.get("loadDate"), + "responseCode": obj.get("responseCode"), + "pageTimings": RealUserEndpointTestPageTimings.from_dict(obj["pageTimings"]) if obj.get("pageTimings") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_detail_result.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_detail_result.py new file mode 100644 index 000000000..0319bfa4e --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_detail_result.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class RealUserEndpointTestPageDetailResult(BaseModel): + """ + RealUserEndpointTestPageDetailResult + """ # noqa: E501 + har: Optional[Dict[str, Any]] = Field(default=None, description="A HAR object according to the [HTTP Archive 1.2 specifications](http://www.softwareishard.com/blog/har-12-spec/), with an additional `systemMetrics` property.") + links: Optional[SelfLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["har", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RealUserEndpointTestPageDetailResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RealUserEndpointTestPageDetailResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "har": obj.get("har"), + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_result.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_result.py new file mode 100644 index 000000000..85b9d8826 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_result.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_timings import RealUserEndpointTestPageTimings +from thousandeyes_sdk.endpoint_test_results.models.system_metrics import SystemMetrics +from typing import Optional, Set +from typing_extensions import Self + +class RealUserEndpointTestPageResult(BaseModel): + """ + RealUserEndpointTestPageResult + """ # noqa: E501 + page_id: Optional[StrictStr] = Field(default=None, description="Web page ID. The page ID is unique only within an endpoint real user test.", alias="pageId") + page_title: Optional[StrictStr] = Field(default=None, description="Web page title.", alias="pageTitle") + page_url: Optional[StrictStr] = Field(default=None, description="Web page url", alias="pageUrl") + load_date: Optional[datetime] = Field(default=None, description="UTC date when page load started (ISO date-time format).", alias="loadDate") + response_code: Optional[StrictInt] = Field(default=None, description="HTTP response code.", alias="responseCode") + page_timings: Optional[RealUserEndpointTestPageTimings] = Field(default=None, alias="pageTimings") + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of endpoint agent, from `/endpoint/agents` endpoint.", alias="agentId") + id: Optional[StrictStr] = Field(default=None, description="Endpoint real user test ID. Each endpoint real user test occurrence has a unique ID.") + round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round.", alias="roundId") + response_time: Optional[StrictInt] = Field(default=None, description="HTTP server response in milliseconds.", alias="responseTime") + system_metrics: Optional[SystemMetrics] = Field(default=None, alias="systemMetrics") + __properties: ClassVar[List[str]] = ["pageId", "pageTitle", "pageUrl", "loadDate", "responseCode", "pageTimings", "agentId", "id", "roundId", "responseTime", "systemMetrics"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RealUserEndpointTestPageResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "page_id", + "page_title", + "page_url", + "load_date", + "response_code", + "agent_id", + "id", + "round_id", + "response_time", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of page_timings + if self.page_timings: + _dict['pageTimings'] = self.page_timings.to_dict() + # override the default output from pydantic by calling `to_dict()` of system_metrics + if self.system_metrics: + _dict['systemMetrics'] = self.system_metrics.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RealUserEndpointTestPageResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "pageId": obj.get("pageId"), + "pageTitle": obj.get("pageTitle"), + "pageUrl": obj.get("pageUrl"), + "loadDate": obj.get("loadDate"), + "responseCode": obj.get("responseCode"), + "pageTimings": RealUserEndpointTestPageTimings.from_dict(obj["pageTimings"]) if obj.get("pageTimings") is not None else None, + "agentId": obj.get("agentId"), + "id": obj.get("id"), + "roundId": obj.get("roundId"), + "responseTime": obj.get("responseTime"), + "systemMetrics": SystemMetrics.from_dict(obj["systemMetrics"]) if obj.get("systemMetrics") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_results.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_results.py new file mode 100644 index 000000000..b9fb6efbb --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_results.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.pagination_next_link import PaginationNextLink +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_page_result import RealUserEndpointTestPageResult +from typing import Optional, Set +from typing_extensions import Self + +class RealUserEndpointTestPageResults(BaseModel): + """ + RealUserEndpointTestPageResults + """ # noqa: E501 + results: Optional[List[RealUserEndpointTestPageResult]] = None + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + links: Optional[PaginationNextLink] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "startDate", "endDate", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RealUserEndpointTestPageResults from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "start_date", + "end_date", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RealUserEndpointTestPageResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [RealUserEndpointTestPageResult.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "_links": PaginationNextLink.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_timings.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_timings.py new file mode 100644 index 000000000..94bfece0c --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_page_timings.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class RealUserEndpointTestPageTimings(BaseModel): + """ + RealUserEndpointTestPageTimings + """ # noqa: E501 + on_content_load: Optional[StrictInt] = Field(default=None, description="DOM load time in milliseconds.", alias="onContentLoad") + on_load: Optional[StrictInt] = Field(default=None, description="Page load time in milliseconds.", alias="onLoad") + __properties: ClassVar[List[str]] = ["onContentLoad", "onLoad"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RealUserEndpointTestPageTimings from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "on_content_load", + "on_load", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RealUserEndpointTestPageTimings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "onContentLoad": obj.get("onContentLoad"), + "onLoad": obj.get("onLoad") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_result_request_filter.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_result_request_filter.py new file mode 100644 index 000000000..42ec71382 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_result_request_filter.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.interface_hardware_type import InterfaceHardwareType +from thousandeyes_sdk.endpoint_test_results.models.platform import Platform +from thousandeyes_sdk.endpoint_test_results.models.trigger import Trigger +from typing import Optional, Set +from typing_extensions import Self + +class RealUserEndpointTestResultRequestFilter(BaseModel): + """ + RealUserEndpointTestResultRequestFilter + """ # noqa: E501 + location: Optional[List[StrictStr]] = Field(default=None, description="Location of the endpoint agent.") + connection: Optional[List[InterfaceHardwareType]] = None + platform: Optional[List[Platform]] = None + gateway: Optional[List[StrictStr]] = Field(default=None, description="Endpoint agent default gateway IP address.") + proxy_target: Optional[List[StrictStr]] = Field(default=None, description="Endpoint agent proxy IP address.", alias="proxyTarget") + vpn_target: Optional[List[StrictStr]] = Field(default=None, description="Endpoint agent VPN endpoint IP address.", alias="vpnTarget") + agent_id: Optional[List[StrictStr]] = Field(default=None, description="Endpoint agent ID.", alias="agentId") + network_id: Optional[List[StrictStr]] = Field(default=None, description="Network ID.", alias="networkId") + ssid: Optional[List[StrictStr]] = Field(default=None, description="WiFi SSID.") + bssid: Optional[List[StrictStr]] = Field(default=None, description="WiFi BSSID.") + destination_ip: Optional[List[StrictStr]] = Field(default=None, description="Web site destination IP address.", alias="destinationIp") + domain: Optional[List[StrictStr]] = Field(default=None, description="Web site base domain visited during the session.") + trigger: Optional[List[Trigger]] = Field(default=None, description="Real user test trigger.") + visited_site: Optional[List[StrictStr]] = Field(default=None, description="Web site domain visited during the session.", alias="visitedSite") + __properties: ClassVar[List[str]] = ["location", "connection", "platform", "gateway", "proxyTarget", "vpnTarget", "agentId", "networkId", "ssid", "bssid", "destinationIp", "domain", "trigger", "visitedSite"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RealUserEndpointTestResultRequestFilter from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RealUserEndpointTestResultRequestFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "location": obj.get("location"), + "connection": obj.get("connection"), + "platform": obj.get("platform"), + "gateway": obj.get("gateway"), + "proxyTarget": obj.get("proxyTarget"), + "vpnTarget": obj.get("vpnTarget"), + "agentId": obj.get("agentId"), + "networkId": obj.get("networkId"), + "ssid": obj.get("ssid"), + "bssid": obj.get("bssid"), + "destinationIp": obj.get("destinationIp"), + "domain": obj.get("domain"), + "trigger": obj.get("trigger"), + "visitedSite": obj.get("visitedSite") + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_results.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_results.py new file mode 100644 index 000000000..37424f251 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_results.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.pagination_next_link import PaginationNextLink +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test import RealUserEndpointTest +from typing import Optional, Set +from typing_extensions import Self + +class RealUserEndpointTestResults(BaseModel): + """ + RealUserEndpointTestResults + """ # noqa: E501 + results: Optional[List[RealUserEndpointTest]] = None + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + links: Optional[PaginationNextLink] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["results", "startDate", "endDate", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RealUserEndpointTestResults from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "start_date", + "end_date", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RealUserEndpointTestResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [RealUserEndpointTest.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "_links": PaginationNextLink.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_results_request.py b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_results_request.py new file mode 100644 index 000000000..c241a6999 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/src/thousandeyes_sdk/endpoint_test_results/models/real_user_endpoint_test_results_request.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.endpoint_test_results.models.real_user_endpoint_test_result_request_filter import RealUserEndpointTestResultRequestFilter +from typing import Optional, Set +from typing_extensions import Self + +class RealUserEndpointTestResultsRequest(BaseModel): + """ + RealUserEndpointTestResultsRequest + """ # noqa: E501 + search_filters: Optional[RealUserEndpointTestResultRequestFilter] = Field(default=None, alias="searchFilters") + __properties: ClassVar[List[str]] = ["searchFilters"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RealUserEndpointTestResultsRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of search_filters + if self.search_filters: + _dict['searchFilters'] = self.search_filters.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RealUserEndpointTestResultsRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "searchFilters": RealUserEndpointTestResultRequestFilter.from_dict(obj["searchFilters"]) if obj.get("searchFilters") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-endpoint-test-results/test/test_http_server_endpoint_scheduled_test_results_api.py b/thousandeyes-sdk-endpoint-test-results/test/test_http_server_endpoint_scheduled_test_results_api.py new file mode 100644 index 000000000..6e9544911 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/test/test_http_server_endpoint_scheduled_test_results_api.py @@ -0,0 +1,598 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.endpoint_test_results.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.endpoint_test_results.api.http_server_endpoint_scheduled_test_results_api import HTTPServerEndpointScheduledTestResultsApi + + +class TestHTTPServerEndpointScheduledTestResultsApi(unittest.TestCase): + """HTTPServerEndpointScheduledTestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = HTTPServerEndpointScheduledTestResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_http_server_scheduled_test_results_models_validation(self) -> None: + """Test case for get_http_server_scheduled_test_results request and response models""" + + response_body_json = """ + { + "test" : { + "server" : "www.example.com", + "isSavedEvent" : false, + "sslVersion" : "Auto", + "useNtlm" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "httpTimeLimit" : 5000, + "type" : "http-server", + "protocol" : "icmp", + "httpVersion" : 2, + "followRedirects" : true, + "authType" : "none", + "testName" : "Test name", + "verifyCertificate" : true, + "networkMeasurements" : true, + "tcpProbeMode" : "auto", + "url" : "https://example.com:443", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "httpTargetTime" : 100, + "username" : "username", + "sslVersionId" : "0" + }, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "headers" : { + "requestHeaders" : "GET / HTTP/1.1\\r\\nHost: www.thousandeyes.com\\r\\nUser-Agent: curl/7.58.0-DEV\\r\\nAccept: */*\\r\\nAccept-Encoding: deflate, gzip\\r\\nX-ThousandEyes-Agent: yes\\r\\n", + "responseHeaders" : "HTTP/1.1 200 OK\\r\\nContent-Type: text/html;charset=UTF-8\\r\\nContent-Length: 9993\\r\\nConnection: keep-alive\\r\\nDate: Mon, 04 May 2020 16:13:00 GMT\\r\\nServer: Apache\\r\\nContent-Language: en-US\\r\\nContent-Encoding: gzip\\r\\nX-Frame-Options: sameorigin\\r\\nCache-Control: max-age=600, must-revalidate\\r\\nStrict-Transport-Security: max-age=31536000\\r\\nX-Content-Type-Options: nosniff\\r\\nX-XSS-Protection: 1; mode=block\\r\\nVary: Accept-Encoding\\r\\nX-Cache: Hit from cloudfront\\r\\nVia: 1.1 7ba3caf71ae7a52dd411d1a543e80cd8.cloudfront.net (CloudFront)\\r\\nX-Amz-Cf-Pop: SFO5-C3\\r\\nX-Amz-Cf-Id: w4h42tkoJD-rEpkRDZUvnQBmy26GVGe6pUsuRr1Dphf7oajYbjXaOA==\\r\\nAge: 132\\r\\n" + }, + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "redirectTime" : 10, + "numRedirects" : 0, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "errorType" : "connect", + "responseTime" : 14, + "totalTime" : 15, + "responseCode" : 200, + "receiveTime" : 1, + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "connectTime" : 2, + "dnsTime" : 0, + "serverIp" : "193.2.1.88", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "sslTime" : 9, + "aid" : "1234", + "roundId" : 1384309800, + "waitTime" : 3, + "errorDetails" : "errorDetails", + "wireSize" : 9993 + }, { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "headers" : { + "requestHeaders" : "GET / HTTP/1.1\\r\\nHost: www.thousandeyes.com\\r\\nUser-Agent: curl/7.58.0-DEV\\r\\nAccept: */*\\r\\nAccept-Encoding: deflate, gzip\\r\\nX-ThousandEyes-Agent: yes\\r\\n", + "responseHeaders" : "HTTP/1.1 200 OK\\r\\nContent-Type: text/html;charset=UTF-8\\r\\nContent-Length: 9993\\r\\nConnection: keep-alive\\r\\nDate: Mon, 04 May 2020 16:13:00 GMT\\r\\nServer: Apache\\r\\nContent-Language: en-US\\r\\nContent-Encoding: gzip\\r\\nX-Frame-Options: sameorigin\\r\\nCache-Control: max-age=600, must-revalidate\\r\\nStrict-Transport-Security: max-age=31536000\\r\\nX-Content-Type-Options: nosniff\\r\\nX-XSS-Protection: 1; mode=block\\r\\nVary: Accept-Encoding\\r\\nX-Cache: Hit from cloudfront\\r\\nVia: 1.1 7ba3caf71ae7a52dd411d1a543e80cd8.cloudfront.net (CloudFront)\\r\\nX-Amz-Cf-Pop: SFO5-C3\\r\\nX-Amz-Cf-Id: w4h42tkoJD-rEpkRDZUvnQBmy26GVGe6pUsuRr1Dphf7oajYbjXaOA==\\r\\nAge: 132\\r\\n" + }, + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "redirectTime" : 10, + "numRedirects" : 0, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "errorType" : "connect", + "responseTime" : 14, + "totalTime" : 15, + "responseCode" : 200, + "receiveTime" : 1, + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "connectTime" : 2, + "dnsTime" : 0, + "serverIp" : "193.2.1.88", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "sslTime" : 9, + "aid" : "1234", + "roundId" : 1384309800, + "waitTime" : 3, + "errorDetails" : "errorDetails", + "wireSize" : 9993 + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_multi_test_filtered_http_server_scheduled_test_results_models_validation(self) -> None: + """Test case for get_multi_test_filtered_http_server_scheduled_test_results request and response models""" + request_body_json = """ + { + "searchSort" : [ { + "sort" : "round-id", + "order" : "desc" + }, { + "sort" : "round-id", + "order" : "desc" + } ], + "searchFilters" : { + "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ], + "testId" : [ "5", "5" ] + }, + "thresholdFilter" : { + "conditionalOperator" : "and", + "filters" : [ { + "name" : "response-time", + "value" : 10.0, + "operator" : "gte" + }, { + "name" : "response-time", + "value" : 10.0, + "operator" : "gte" + } ] + } + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestsDataRoundsSearch.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "totalHits" : 12, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "headers" : { + "requestHeaders" : "GET / HTTP/1.1\\r\\nHost: www.thousandeyes.com\\r\\nUser-Agent: curl/7.58.0-DEV\\r\\nAccept: */*\\r\\nAccept-Encoding: deflate, gzip\\r\\nX-ThousandEyes-Agent: yes\\r\\n", + "responseHeaders" : "HTTP/1.1 200 OK\\r\\nContent-Type: text/html;charset=UTF-8\\r\\nContent-Length: 9993\\r\\nConnection: keep-alive\\r\\nDate: Mon, 04 May 2020 16:13:00 GMT\\r\\nServer: Apache\\r\\nContent-Language: en-US\\r\\nContent-Encoding: gzip\\r\\nX-Frame-Options: sameorigin\\r\\nCache-Control: max-age=600, must-revalidate\\r\\nStrict-Transport-Security: max-age=31536000\\r\\nX-Content-Type-Options: nosniff\\r\\nX-XSS-Protection: 1; mode=block\\r\\nVary: Accept-Encoding\\r\\nX-Cache: Hit from cloudfront\\r\\nVia: 1.1 7ba3caf71ae7a52dd411d1a543e80cd8.cloudfront.net (CloudFront)\\r\\nX-Amz-Cf-Pop: SFO5-C3\\r\\nX-Amz-Cf-Id: w4h42tkoJD-rEpkRDZUvnQBmy26GVGe6pUsuRr1Dphf7oajYbjXaOA==\\r\\nAge: 132\\r\\n" + }, + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "redirectTime" : 10, + "numRedirects" : 0, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "errorType" : "connect", + "responseTime" : 14, + "totalTime" : 15, + "responseCode" : 200, + "receiveTime" : 1, + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "connectTime" : 2, + "dnsTime" : 0, + "serverIp" : "193.2.1.88", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "sslTime" : 9, + "aid" : "1234", + "roundId" : 1384309800, + "waitTime" : 3, + "errorDetails" : "errorDetails", + "wireSize" : 9993 + }, { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "headers" : { + "requestHeaders" : "GET / HTTP/1.1\\r\\nHost: www.thousandeyes.com\\r\\nUser-Agent: curl/7.58.0-DEV\\r\\nAccept: */*\\r\\nAccept-Encoding: deflate, gzip\\r\\nX-ThousandEyes-Agent: yes\\r\\n", + "responseHeaders" : "HTTP/1.1 200 OK\\r\\nContent-Type: text/html;charset=UTF-8\\r\\nContent-Length: 9993\\r\\nConnection: keep-alive\\r\\nDate: Mon, 04 May 2020 16:13:00 GMT\\r\\nServer: Apache\\r\\nContent-Language: en-US\\r\\nContent-Encoding: gzip\\r\\nX-Frame-Options: sameorigin\\r\\nCache-Control: max-age=600, must-revalidate\\r\\nStrict-Transport-Security: max-age=31536000\\r\\nX-Content-Type-Options: nosniff\\r\\nX-XSS-Protection: 1; mode=block\\r\\nVary: Accept-Encoding\\r\\nX-Cache: Hit from cloudfront\\r\\nVia: 1.1 7ba3caf71ae7a52dd411d1a543e80cd8.cloudfront.net (CloudFront)\\r\\nX-Amz-Cf-Pop: SFO5-C3\\r\\nX-Amz-Cf-Id: w4h42tkoJD-rEpkRDZUvnQBmy26GVGe6pUsuRr1Dphf7oajYbjXaOA==\\r\\nAge: 132\\r\\n" + }, + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "redirectTime" : 10, + "numRedirects" : 0, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "errorType" : "connect", + "responseTime" : 14, + "totalTime" : 15, + "responseCode" : 200, + "receiveTime" : 1, + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "connectTime" : 2, + "dnsTime" : 0, + "serverIp" : "193.2.1.88", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "sslTime" : 9, + "aid" : "1234", + "roundId" : 1384309800, + "waitTime" : 3, + "errorDetails" : "errorDetails", + "wireSize" : 9993 + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_test_results.models.HttpMultiEndpointTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-endpoint-test-results/test/test_local_network_endpoint_test_results_api.py b/thousandeyes-sdk-endpoint-test-results/test/test_local_network_endpoint_test_results_api.py new file mode 100644 index 000000000..a89529d16 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/test/test_local_network_endpoint_test_results_api.py @@ -0,0 +1,559 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.endpoint_test_results.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.endpoint_test_results.api.local_network_endpoint_test_results_api import LocalNetworkEndpointTestResultsApi + + +class TestLocalNetworkEndpointTestResultsApi(unittest.TestCase): + """LocalNetworkEndpointTestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = LocalNetworkEndpointTestResultsApi() + + def tearDown(self) -> None: + pass + + def test_filter_local_networks_test_results_topologies_models_validation(self) -> None: + """Test case for filter_local_networks_test_results_topologies request and response models""" + request_body_json = """ + { + "searchFilters" : { + "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ], + "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ], + "location" : [ "San Francisco Bay Area", "Germany" ], + "connection" : [ "wireless", "wireless" ], + "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ], + "networkId" : [ "660b34109d12", "660b34109d15" ], + "type" : [ "vpn", "proxy" ], + "ssid" : [ "wifi-name", "other-room-wifi" ], + "platform" : [ "mac", "mac" ], + "gateway" : [ "78.153.54.204", "78.153.54.206" ], + "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ] + } + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_test_results.models.EndpointNetworkTopologyResultRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "isIcmpBlocked" : true, + "tcpConnect" : { + "rtt" : 77.777, + "errorCode" : "ERR_TIMED_OUT", + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ] + }, + "icmpPing" : { + "maxRtt" : 66, + "pktsReceived" : 10, + "avgRtt" : 7, + "meanDevRtt" : 11, + "minRtt" : 1, + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "pktsSent" : 10 + }, + "type" : "vpn", + "networkTopologyId" : "00160:54c3a4b180c6:1490536500:c7a58c49", + "roundId" : 1384309800, + "targetPort" : 80, + "target" : "10.0.2.2" + }, { + "date" : "2022-07-17T22:00:54Z", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "isIcmpBlocked" : true, + "tcpConnect" : { + "rtt" : 77.777, + "errorCode" : "ERR_TIMED_OUT", + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ] + }, + "icmpPing" : { + "maxRtt" : 66, + "pktsReceived" : 10, + "avgRtt" : 7, + "meanDevRtt" : 11, + "minRtt" : 1, + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "pktsSent" : 10 + }, + "type" : "vpn", + "networkTopologyId" : "00160:54c3a4b180c6:1490536500:c7a58c49", + "roundId" : 1384309800, + "targetPort" : 80, + "target" : "10.0.2.2" + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_test_results.models.LocalNetworkTopologyResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_local_networks_test_results_models_validation(self) -> None: + """Test case for get_local_networks_test_results request and response models""" + + response_body_json = """ + { + "localNetworks" : [ { + "publicIpRange" : "178.216.56.0-178.216.63.255", + "networkName" : "10.5.51.0 (in 178.216.56.0/21)", + "networkId" : "006c4fa7a054", + "localPrefix" : "10.5.51.0" + }, { + "publicIpRange" : "178.216.56.0-178.216.63.255", + "networkName" : "10.5.51.0 (in 178.216.56.0/21)", + "networkId" : "006c4fa7a054", + "localPrefix" : "10.5.51.0" + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_test_results.models.LocalNetworkResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_local_networks_test_results_topology_models_validation(self) -> None: + """Test case for get_local_networks_test_results_topology request and response models""" + + response_body_json = """ + { + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "isIcmpBlocked" : true, + "tcpConnect" : { + "rtt" : 77.777, + "errorCode" : "ERR_TIMED_OUT", + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ] + }, + "coordinates" : { + "latitude" : 46.0552778, + "location" : "Slovenia", + "longitude" : 14.5144444 + }, + "icmpTraceroutes" : [ { + "destination" : "13.32.22.232", + "hops" : [ { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + }, { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + } ], + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ] + }, { + "destination" : "13.32.22.232", + "hops" : [ { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + }, { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + } ], + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ] + } ], + "type" : "vpn", + "targetPort" : 80, + "target" : "10.0.2.2", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "icmpTraceroute" : { + "destination" : "13.32.22.232", + "hops" : [ { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + }, { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + } ], + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ] + }, + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "icmpPing" : { + "maxRtt" : 66, + "pktsReceived" : 10, + "avgRtt" : 7, + "meanDevRtt" : 11, + "minRtt" : 1, + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "pktsSent" : 10 + }, + "networkTopologyId" : "00160:54c3a4b180c6:1490536500:c7a58c49", + "roundId" : 1384309800 + }, { + "date" : "2022-07-17T22:00:54Z", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "isIcmpBlocked" : true, + "tcpConnect" : { + "rtt" : 77.777, + "errorCode" : "ERR_TIMED_OUT", + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ] + }, + "coordinates" : { + "latitude" : 46.0552778, + "location" : "Slovenia", + "longitude" : 14.5144444 + }, + "icmpTraceroutes" : [ { + "destination" : "13.32.22.232", + "hops" : [ { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + }, { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + } ], + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ] + }, { + "destination" : "13.32.22.232", + "hops" : [ { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + }, { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + } ], + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ] + } ], + "type" : "vpn", + "targetPort" : 80, + "target" : "10.0.2.2", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "icmpTraceroute" : { + "destination" : "13.32.22.232", + "hops" : [ { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + }, { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + } ], + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ] + }, + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "icmpPing" : { + "maxRtt" : 66, + "pktsReceived" : 10, + "avgRtt" : 7, + "meanDevRtt" : 11, + "minRtt" : 1, + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "pktsSent" : 10 + }, + "networkTopologyId" : "00160:54c3a4b180c6:1490536500:c7a58c49", + "roundId" : 1384309800 + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_test_results.models.LocalNetworkTopologyDetailResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-endpoint-test-results/test/test_network_dynamic_endpoint_test_results_api.py b/thousandeyes-sdk-endpoint-test-results/test/test_network_dynamic_endpoint_test_results_api.py new file mode 100644 index 000000000..acdde4da1 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/test/test_network_dynamic_endpoint_test_results_api.py @@ -0,0 +1,1111 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.endpoint_test_results.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.endpoint_test_results.api.network_dynamic_endpoint_test_results_api import NetworkDynamicEndpointTestResultsApi + + +class TestNetworkDynamicEndpointTestResultsApi(unittest.TestCase): + """NetworkDynamicEndpointTestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = NetworkDynamicEndpointTestResultsApi() + + def tearDown(self) -> None: + pass + + def test_filter_dynamic_test_network_results_models_validation(self) -> None: + """Test case for filter_dynamic_test_network_results request and response models""" + request_body_json = """ + { + "searchSort" : [ { + "sort" : "round-id", + "order" : "desc" + }, { + "sort" : "round-id", + "order" : "desc" + } ], + "searchFilters" : { + "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ], + "webexConferenceId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ] + }, + "thresholdFilter" : { + "conditionalOperator" : "and", + "filters" : [ { + "name" : "loss", + "value" : 10.0, + "operator" : "gte" + }, { + "name" : "loss", + "value" : 10.0, + "operator" : "gte" + } ] + } + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_test_results.models.DynamicEndpointTestsDataRoundSearch.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "test" : { + "hasPing" : true, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "tcpProbeMode" : "auto", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "application" : "webex", + "hasTraceroute" : true, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + }, + "totalHits" : 12, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "udpProbeMode" : "unknown", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "isIcmpBlocked" : true, + "avgLatency" : 167.04, + "minLatency" : 167.0, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "maxLatency" : 168.0, + "tcpProbeMode" : "auto", + "loss" : 0.0, + "protocol" : "tcp", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "jitter" : 0.076808, + "application" : "webex", + "serverIp" : "185.199.108.153", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "webex" : { + "remoteSipSessionId" : "22581707460321454", + "localSipSessionId" : "22581707460321454", + "conferenceId" : "225817074608419375", + "correlationId" : "22581707460321454" + }, + "aid" : "1234", + "roundId" : 1384309800, + "errorDetails" : "Error" + }, { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "udpProbeMode" : "unknown", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "isIcmpBlocked" : true, + "avgLatency" : 167.04, + "minLatency" : 167.0, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "maxLatency" : 168.0, + "tcpProbeMode" : "auto", + "loss" : 0.0, + "protocol" : "tcp", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "jitter" : 0.076808, + "application" : "webex", + "serverIp" : "185.199.108.153", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "webex" : { + "remoteSipSessionId" : "22581707460321454", + "localSipSessionId" : "22581707460321454", + "conferenceId" : "225817074608419375", + "correlationId" : "22581707460321454" + }, + "aid" : "1234", + "roundId" : 1384309800, + "errorDetails" : "Error" + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_test_results.models.NetworkDynamicEndpointTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_dynamic_test_path_vis_agent_round_results_models_validation(self) -> None: + """Test case for get_dynamic_test_path_vis_agent_round_results request and response models""" + + response_body_json = """ + { + "test" : { + "hasPing" : true, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "tcpProbeMode" : "auto", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "application" : "webex", + "hasTraceroute" : true, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + }, + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "server" : "www.google.com:443", + "udpProbeMode" : "unknown", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "asnDetails" : { + "asName" : "ThousandEyes, Inc", + "asNumber" : 394101 + }, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "sourcePrefix" : "196.40.96.0/20", + "tcpProbeMode" : "auto", + "protocol" : "tcp", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "sourceIp" : "196.40.106.237", + "application" : "webex", + "pathTraces" : [ { + "protocol" : "tcp", + "udpPathTraceMode" : "unknown", + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803", + "tcpPathTraceMode" : "auto" + }, { + "protocol" : "tcp", + "udpPathTraceMode" : "unknown", + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803", + "tcpPathTraceMode" : "auto" + } ], + "vpnPathTraces" : [ { + "protocol" : "tcp", + "udpPathTraceMode" : "unknown", + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803", + "tcpPathTraceMode" : "auto" + }, { + "protocol" : "tcp", + "udpPathTraceMode" : "unknown", + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803", + "tcpPathTraceMode" : "auto" + } ], + "serverIp" : "185.199.108.153", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "webex" : { + "remoteSipSessionId" : "22581707460321454", + "localSipSessionId" : "22581707460321454", + "conferenceId" : "225817074608419375", + "correlationId" : "22581707460321454" + }, + "aid" : "1234", + "roundId" : 1384309800 + }, { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "server" : "www.google.com:443", + "udpProbeMode" : "unknown", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "asnDetails" : { + "asName" : "ThousandEyes, Inc", + "asNumber" : 394101 + }, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "sourcePrefix" : "196.40.96.0/20", + "tcpProbeMode" : "auto", + "protocol" : "tcp", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "sourceIp" : "196.40.106.237", + "application" : "webex", + "pathTraces" : [ { + "protocol" : "tcp", + "udpPathTraceMode" : "unknown", + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803", + "tcpPathTraceMode" : "auto" + }, { + "protocol" : "tcp", + "udpPathTraceMode" : "unknown", + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803", + "tcpPathTraceMode" : "auto" + } ], + "vpnPathTraces" : [ { + "protocol" : "tcp", + "udpPathTraceMode" : "unknown", + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803", + "tcpPathTraceMode" : "auto" + }, { + "protocol" : "tcp", + "udpPathTraceMode" : "unknown", + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803", + "tcpPathTraceMode" : "auto" + } ], + "serverIp" : "185.199.108.153", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "webex" : { + "remoteSipSessionId" : "22581707460321454", + "localSipSessionId" : "22581707460321454", + "conferenceId" : "225817074608419375", + "correlationId" : "22581707460321454" + }, + "aid" : "1234", + "roundId" : 1384309800 + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_test_results.models.PathVisDetailDynamicEndpointTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_dynamic_test_path_vis_results_models_validation(self) -> None: + """Test case for get_dynamic_test_path_vis_results request and response models""" + + response_body_json = """ + { + "test" : { + "hasPing" : true, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "tcpProbeMode" : "auto", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "application" : "webex", + "hasTraceroute" : true, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + }, + "endDate" : "2022-07-18T22:00:54Z", + "totalHits" : 12, + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "server" : "www.google.com:443", + "udpProbeMode" : "unknown", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "asnDetails" : { + "asName" : "ThousandEyes, Inc", + "asNumber" : 394101 + }, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "sourcePrefix" : "196.40.96.0/20", + "tcpProbeMode" : "auto", + "protocol" : "tcp", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "sourceIp" : "196.40.106.237", + "application" : "webex", + "pathTraces" : [ { + "protocol" : "tcp", + "numberOfHops" : 15, + "responseTime" : 1500, + "ipAddress" : "196.40.106.237", + "udpPathTraceMode" : "unknown", + "pathId" : "1230899668701775614109128428722974545787322404682781961521", + "tcpPathTraceMode" : "auto" + }, { + "protocol" : "tcp", + "numberOfHops" : 15, + "responseTime" : 1500, + "ipAddress" : "196.40.106.237", + "udpPathTraceMode" : "unknown", + "pathId" : "1230899668701775614109128428722974545787322404682781961521", + "tcpPathTraceMode" : "auto" + } ], + "serverIp" : "185.199.108.153", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "location" : "San Francisco Area", + "webex" : { + "remoteSipSessionId" : "22581707460321454", + "localSipSessionId" : "22581707460321454", + "conferenceId" : "225817074608419375", + "correlationId" : "22581707460321454" + }, + "aid" : "1234", + "roundId" : 1384309800 + }, { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "server" : "www.google.com:443", + "udpProbeMode" : "unknown", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "asnDetails" : { + "asName" : "ThousandEyes, Inc", + "asNumber" : 394101 + }, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "sourcePrefix" : "196.40.96.0/20", + "tcpProbeMode" : "auto", + "protocol" : "tcp", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "sourceIp" : "196.40.106.237", + "application" : "webex", + "pathTraces" : [ { + "protocol" : "tcp", + "numberOfHops" : 15, + "responseTime" : 1500, + "ipAddress" : "196.40.106.237", + "udpPathTraceMode" : "unknown", + "pathId" : "1230899668701775614109128428722974545787322404682781961521", + "tcpPathTraceMode" : "auto" + }, { + "protocol" : "tcp", + "numberOfHops" : 15, + "responseTime" : 1500, + "ipAddress" : "196.40.106.237", + "udpPathTraceMode" : "unknown", + "pathId" : "1230899668701775614109128428722974545787322404682781961521", + "tcpPathTraceMode" : "auto" + } ], + "serverIp" : "185.199.108.153", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "location" : "San Francisco Area", + "webex" : { + "remoteSipSessionId" : "22581707460321454", + "localSipSessionId" : "22581707460321454", + "conferenceId" : "225817074608419375", + "correlationId" : "22581707460321454" + }, + "aid" : "1234", + "roundId" : 1384309800 + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_test_results.models.PathVisDynamicEndpointTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-endpoint-test-results/test/test_network_endpoint_scheduled_test_results_api.py b/thousandeyes-sdk-endpoint-test-results/test/test_network_endpoint_scheduled_test_results_api.py new file mode 100644 index 000000000..56147a584 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/test/test_network_endpoint_scheduled_test_results_api.py @@ -0,0 +1,1291 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.endpoint_test_results.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.endpoint_test_results.api.network_endpoint_scheduled_test_results_api import NetworkEndpointScheduledTestResultsApi + + +class TestNetworkEndpointScheduledTestResultsApi(unittest.TestCase): + """NetworkEndpointScheduledTestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = NetworkEndpointScheduledTestResultsApi() + + def tearDown(self) -> None: + pass + + def test_filter_scheduled_test_network_results_models_validation(self) -> None: + """Test case for filter_scheduled_test_network_results request and response models""" + request_body_json = """ + { + "searchSort" : [ { + "sort" : "round-id", + "order" : "desc" + }, { + "sort" : "round-id", + "order" : "desc" + } ], + "searchFilters" : { + "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ] + }, + "thresholdFilter" : { + "conditionalOperator" : "and", + "filters" : [ { + "name" : "loss", + "value" : 10.0, + "operator" : "gte" + }, { + "name" : "loss", + "value" : 10.0, + "operator" : "gte" + } ] + } + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_test_results.models.EndpointTestsDataRoundsSearch.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "test" : { + "server" : "www.example.com", + "isSavedEvent" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "type" : "agent-to-server", + "tcpProbeMode" : "auto", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + }, + "totalHits" : 12, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "isIcmpBlocked" : true, + "avgLatency" : 167.04, + "minLatency" : 167.0, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "maxLatency" : 168.0, + "loss" : 0.0, + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "jitter" : 0.076808, + "serverIp" : "185.199.108.153", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "aid" : "1234", + "roundId" : 1384309800, + "errorDetails" : "Error" + }, { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "isIcmpBlocked" : true, + "avgLatency" : 167.04, + "minLatency" : 167.0, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "maxLatency" : 168.0, + "loss" : 0.0, + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "jitter" : 0.076808, + "serverIp" : "185.199.108.153", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "aid" : "1234", + "roundId" : 1384309800, + "errorDetails" : "Error" + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_test_results.models.NetworkEndpointTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_filter_scheduled_tests_network_results_models_validation(self) -> None: + """Test case for filter_scheduled_tests_network_results request and response models""" + request_body_json = """ + { + "searchSort" : [ { + "sort" : "round-id", + "order" : "desc" + }, { + "sort" : "round-id", + "order" : "desc" + } ], + "searchFilters" : { + "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ], + "testId" : [ "5", "5" ] + }, + "thresholdFilter" : { + "conditionalOperator" : "and", + "filters" : [ { + "name" : "loss", + "value" : 10.0, + "operator" : "gte" + }, { + "name" : "loss", + "value" : 10.0, + "operator" : "gte" + } ] + } + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_test_results.models.MultiTestIdEndpointTestsDataRoundsSearch.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "totalHits" : 12, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "isIcmpBlocked" : true, + "avgLatency" : 167.04, + "minLatency" : 167.0, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "maxLatency" : 168.0, + "loss" : 0.0, + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "jitter" : 0.076808, + "serverIp" : "185.199.108.153", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "aid" : "1234", + "roundId" : 1384309800, + "errorDetails" : "Error" + }, { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "isIcmpBlocked" : true, + "avgLatency" : 167.04, + "minLatency" : 167.0, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "maxLatency" : 168.0, + "loss" : 0.0, + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "jitter" : 0.076808, + "serverIp" : "185.199.108.153", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "aid" : "1234", + "roundId" : 1384309800, + "errorDetails" : "Error" + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_test_results.models.MultiTestIdNetworkEndpointTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_scheduled_test_path_vis_agent_round_results_models_validation(self) -> None: + """Test case for get_scheduled_test_path_vis_agent_round_results request and response models""" + + response_body_json = """ + { + "test" : { + "server" : "www.example.com", + "isSavedEvent" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "type" : "agent-to-server", + "tcpProbeMode" : "auto", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + }, + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "server" : "www.google.com:443", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "asnDetails" : { + "asName" : "ThousandEyes, Inc", + "asNumber" : 394101 + }, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "sourcePrefix" : "196.40.96.0/20", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "sourceIp" : "196.40.106.237", + "pathTraces" : [ { + "protocol" : "tcp", + "udpPathTraceMode" : "unknown", + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803", + "tcpPathTraceMode" : "auto" + }, { + "protocol" : "tcp", + "udpPathTraceMode" : "unknown", + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803", + "tcpPathTraceMode" : "auto" + } ], + "vpnPathTraces" : [ { + "protocol" : "tcp", + "udpPathTraceMode" : "unknown", + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803", + "tcpPathTraceMode" : "auto" + }, { + "protocol" : "tcp", + "udpPathTraceMode" : "unknown", + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803", + "tcpPathTraceMode" : "auto" + } ], + "serverIp" : "185.199.108.153", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "aid" : "1234", + "roundId" : 1384309800 + }, { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "server" : "www.google.com:443", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "asnDetails" : { + "asName" : "ThousandEyes, Inc", + "asNumber" : 394101 + }, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "sourcePrefix" : "196.40.96.0/20", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "sourceIp" : "196.40.106.237", + "pathTraces" : [ { + "protocol" : "tcp", + "udpPathTraceMode" : "unknown", + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803", + "tcpPathTraceMode" : "auto" + }, { + "protocol" : "tcp", + "udpPathTraceMode" : "unknown", + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803", + "tcpPathTraceMode" : "auto" + } ], + "vpnPathTraces" : [ { + "protocol" : "tcp", + "udpPathTraceMode" : "unknown", + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803", + "tcpPathTraceMode" : "auto" + }, { + "protocol" : "tcp", + "udpPathTraceMode" : "unknown", + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803", + "tcpPathTraceMode" : "auto" + } ], + "serverIp" : "185.199.108.153", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "aid" : "1234", + "roundId" : 1384309800 + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_test_results.models.PathVisDetailEndpointTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_scheduled_test_path_vis_results_models_validation(self) -> None: + """Test case for get_scheduled_test_path_vis_results request and response models""" + + response_body_json = """ + { + "test" : { + "server" : "www.example.com", + "isSavedEvent" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "type" : "agent-to-server", + "tcpProbeMode" : "auto", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + }, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "server" : "www.google.com:443", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "asnDetails" : { + "asName" : "ThousandEyes, Inc", + "asNumber" : 394101 + }, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "sourcePrefix" : "196.40.96.0/20", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "sourceIp" : "196.40.106.237", + "pathTraces" : [ { + "protocol" : "tcp", + "numberOfHops" : 15, + "responseTime" : 1500, + "ipAddress" : "196.40.106.237", + "udpPathTraceMode" : "unknown", + "pathId" : "1230899668701775614109128428722974545787322404682781961521", + "tcpPathTraceMode" : "auto" + }, { + "protocol" : "tcp", + "numberOfHops" : 15, + "responseTime" : 1500, + "ipAddress" : "196.40.106.237", + "udpPathTraceMode" : "unknown", + "pathId" : "1230899668701775614109128428722974545787322404682781961521", + "tcpPathTraceMode" : "auto" + } ], + "serverIp" : "185.199.108.153", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "location" : "San Francisco Area", + "aid" : "1234", + "roundId" : 1384309800 + }, { + "originalTargetProfile" : { + "protocol" : "tcp", + "remotePort" : 80, + "remoteIpAddress" : "120.98.134.7" + }, + "server" : "www.google.com:443", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "asnDetails" : { + "asName" : "ThousandEyes, Inc", + "asNumber" : 394101 + }, + "vpnProfile" : { + "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ], + "vpnGatewayAddress" : "120.98.134.7", + "vpnType" : "cisco-anyconnect", + "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ] + }, + "sourcePrefix" : "196.40.96.0/20", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "sourceIp" : "196.40.106.237", + "pathTraces" : [ { + "protocol" : "tcp", + "numberOfHops" : 15, + "responseTime" : 1500, + "ipAddress" : "196.40.106.237", + "udpPathTraceMode" : "unknown", + "pathId" : "1230899668701775614109128428722974545787322404682781961521", + "tcpPathTraceMode" : "auto" + }, { + "protocol" : "tcp", + "numberOfHops" : 15, + "responseTime" : 1500, + "ipAddress" : "196.40.106.237", + "udpPathTraceMode" : "unknown", + "pathId" : "1230899668701775614109128428722974545787322404682781961521", + "tcpPathTraceMode" : "auto" + } ], + "serverIp" : "185.199.108.153", + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "testId" : "584739201", + "location" : "San Francisco Area", + "aid" : "1234", + "roundId" : 1384309800 + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_test_results.models.PathVisEndpointTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-endpoint-test-results/test/test_real_user_endpoint_test_results_api.py b/thousandeyes-sdk-endpoint-test-results/test/test_real_user_endpoint_test_results_api.py new file mode 100644 index 000000000..cebbfdcf8 --- /dev/null +++ b/thousandeyes-sdk-endpoint-test-results/test/test_real_user_endpoint_test_results_api.py @@ -0,0 +1,1016 @@ +# coding: utf-8 + +""" + Endpoint Test Results API + + Retrieve results for scheduled and dynamic tests on endpoint agents. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.endpoint_test_results.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.endpoint_test_results.api.real_user_endpoint_test_results_api import RealUserEndpointTestResultsApi + + +class TestRealUserEndpointTestResultsApi(unittest.TestCase): + """RealUserEndpointTestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = RealUserEndpointTestResultsApi() + + def tearDown(self) -> None: + pass + + def test_filter_real_user_tests_network_results_models_validation(self) -> None: + """Test case for filter_real_user_tests_network_results request and response models""" + request_body_json = """ + { + "searchFilters" : { + "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ], + "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ], + "visitedSite" : [ "app.thousandeyes.com" ], + "trigger" : [ "user" ], + "ssid" : [ "wifi-name", "other-room-wifi" ], + "platform" : [ "mac", "mac" ], + "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ], + "destinationIp" : [ "84.255.241.1", "193.2.1.88" ], + "domain" : [ "thousandeyes.com" ], + "location" : [ "San Francisco Bay Area", "Germany" ], + "connection" : [ "wireless", "wireless" ], + "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ], + "networkId" : [ "660b34109d12", "660b34109d15" ], + "gateway" : [ "78.153.54.204", "78.153.54.206" ] + } + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "proxy" : { + "loss" : 0.1, + "jitter" : 46, + "latency" : 150, + "target" : "54.208.6.220" + }, + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "vpn" : { + "loss" : 0.1, + "jitter" : 46, + "latency" : 150, + "target" : "54.208.6.220" + }, + "destination" : { + "loss" : 0.1, + "jitter" : 46, + "latency" : 150, + "target" : "54.208.6.220" + }, + "id" : "07625:1490529480:aVDViw0i", + "roundId" : 1384309800 + }, { + "date" : "2022-07-17T22:00:54Z", + "proxy" : { + "loss" : 0.1, + "jitter" : 46, + "latency" : 150, + "target" : "54.208.6.220" + }, + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "vpn" : { + "loss" : 0.1, + "jitter" : 46, + "latency" : 150, + "target" : "54.208.6.220" + }, + "destination" : { + "loss" : 0.1, + "jitter" : 46, + "latency" : 150, + "target" : "54.208.6.220" + }, + "id" : "07625:1490529480:aVDViw0i", + "roundId" : 1384309800 + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestNetworkResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_filter_real_user_tests_results_models_validation(self) -> None: + """Test case for filter_real_user_tests_results request and response models""" + request_body_json = """ + { + "searchFilters" : { + "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ], + "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ], + "visitedSite" : [ "app.thousandeyes.com" ], + "trigger" : [ "user" ], + "ssid" : [ "wifi-name", "other-room-wifi" ], + "platform" : [ "mac", "mac" ], + "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ], + "destinationIp" : [ "84.255.241.1", "193.2.1.88" ], + "domain" : [ "thousandeyes.com" ], + "location" : [ "San Francisco Bay Area", "Germany" ], + "connection" : [ "wireless", "wireless" ], + "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ], + "networkId" : [ "660b34109d12", "660b34109d15" ], + "gateway" : [ "78.153.54.204", "78.153.54.206" ] + } + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "committed" : "2022-07-17T22:00:54Z", + "experienceScore" : 0.5, + "sourceAddress" : "84.255.241.1", + "organizationName" : "T-2 Access Network", + "visitedSite" : "www.thousandeyes.com", + "pageId" : "C31gBrYJ", + "protocol" : "https", + "numberOfPages" : 2, + "port" : 443, + "id" : "07625:1490529480:aVDViw0i", + "roundId" : 1384309800 + }, { + "date" : "2022-07-17T22:00:54Z", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "committed" : "2022-07-17T22:00:54Z", + "experienceScore" : 0.5, + "sourceAddress" : "84.255.241.1", + "organizationName" : "T-2 Access Network", + "visitedSite" : "www.thousandeyes.com", + "pageId" : "C31gBrYJ", + "protocol" : "https", + "numberOfPages" : 2, + "port" : 443, + "id" : "07625:1490529480:aVDViw0i", + "roundId" : 1384309800 + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_filter_real_user_tests_visited_pages_results_models_validation(self) -> None: + """Test case for filter_real_user_tests_visited_pages_results request and response models""" + request_body_json = """ + { + "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ], + "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ], + "visitedSite" : [ "app.thousandeyes.com" ], + "trigger" : [ "user" ], + "ssid" : [ "wifi-name", "other-room-wifi" ], + "platform" : [ "mac", "mac" ], + "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ], + "destinationIp" : [ "84.255.241.1", "193.2.1.88" ], + "domain" : [ "thousandeyes.com" ], + "location" : [ "San Francisco Bay Area", "Germany" ], + "connection" : [ "wireless", "wireless" ], + "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ], + "networkId" : [ "660b34109d12", "660b34109d15" ], + "gateway" : [ "78.153.54.204", "78.153.54.206" ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultRequestFilter.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "pageTimings" : { + "onContentLoad" : 1483, + "onLoad" : 4569 + }, + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "pageTitle" : "Network Performance Resources | ThousandEyes", + "responseTime" : 240, + "pageUrl" : "https://app.thousandeyes.com/settings/integrations", + "id" : "07625:1490529480:aVDViw0i", + "pageId" : "C31gBrYJ", + "roundId" : 1384309800, + "loadDate" : "2022-07-17T22:00:54Z", + "responseCode" : 200 + }, { + "pageTimings" : { + "onContentLoad" : 1483, + "onLoad" : 4569 + }, + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "pageTitle" : "Network Performance Resources | ThousandEyes", + "responseTime" : 240, + "pageUrl" : "https://app.thousandeyes.com/settings/integrations", + "id" : "07625:1490529480:aVDViw0i", + "pageId" : "C31gBrYJ", + "roundId" : 1384309800, + "loadDate" : "2022-07-17T22:00:54Z", + "responseCode" : 200 + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestPageResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_real_user_test_page_results_models_validation(self) -> None: + """Test case for get_real_user_test_page_results request and response models""" + + response_body_json = """ + { + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "har" : { + "log" : { + "browser" : { + "name" : "Google Chrome", + "version" : "7.0.19.98" + }, + "creator" : { + "name" : "ThousandEyes Endpoint Agent", + "version" : "7.0.19" + }, + "entries" : [ { + "pageref" : "page_1", + "request" : { + "headers" : [ { + "name" : "Upgrade-Insecure-Requests", + "value" : "1" + }, { + "name" : "User-Agent", + "value" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36" + }, { + "name" : "Accept", + "value" : "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" + }, { + "name" : "Referer", + "value" : "https://www.thousandeyes.com/" + }, { + "name" : "Accept-Encoding", + "value" : "gzip, deflate, sdch, br" + }, { + "name" : "Accept-Language", + "value" : "en-US,en;q=0.6" + }, { + "name" : "Cookie", + "value" : "(removed)" + } ], + "method" : "GET", + "queryString" : [ { + "name" : "locale", + "value" : "en-US" + } ], + "url" : "https://www.thousandeyes.com/resources" + }, + "response" : { + "bodySize" : 17776, + "content" : { + "mimeType" : "text/html;charset=ISO-8859-1", + "size" : 17776 + }, + "headers" : [ { + "name" : "Content-Type", + "value" : "text/html;charset=ISO-8859-1" + }, { + "name" : "Content-Length", + "value" : "17776" + }, { + "name" : "Connection", + "value" : "keep-alive" + }, { + "name" : "Date", + "value" : "Sun, 26 Mar 2017 11:58:54 GMT" + }, { + "name" : "Server", + "value" : "Apache" + }, { + "name" : "Cache-Control", + "value" : "max-age=600, must-revalidate" + }, { + "name" : "Content-Language", + "value" : "en-US" + }, { + "name" : "Content-Encoding", + "value" : "gzip" + }, { + "name" : "X-Frame-Options", + "value" : "sameorigin" + }, { + "name" : "Strict-Transport-Security", + "value" : "max-age=31536000" + }, { + "name" : "Vary", + "value" : "Accept-Encoding" + }, { + "name" : "X-Cache", + "value" : "Miss from cloudfront" + }, { + "name" : "Via", + "value" : "1.1 5dbe09af3a2c87121e31ffa67f174f66.cloudfront.net (CloudFront)" + }, { + "name" : "X-Amz-Cf-Id", + "value" : "YkvlkBNKgHt5aMu9vcS22Z8kHn1MUr-8adupwhDk3j9vF-TpSyIxZA==" + } ], + "headersSize" : 527, + "redirectURL" : "", + "status" : 200, + "statusText" : "OK" + }, + "serverIPAddress" : "13.32.22.80", + "startedDateTime" : "2017-03-22T11:58:54.123+02:00", + "time" : 177, + "timings" : { + "blocked" : -1, + "connect" : -1, + "dns" : -1, + "receive" : 27, + "send" : -1, + "ssl" : -1, + "wait" : 150 + } + }, { + "pageref" : "page_1", + "request" : { + "headers" : [ { + "name" : "User-Agent", + "value" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36" + }, { + "name" : "Accept", + "value" : "*/*" + }, { + "name" : "Referer", + "value" : "https://www.thousandeyes.com/resources" + }, { + "name" : "Accept-Encoding", + "value" : "gzip, deflate, sdch, br" + }, { + "name" : "Accept-Language", + "value" : "en-US,en;q=0.6" + } ], + "method" : "GET", + "queryString" : [ ], + "url" : "https://use.typekit.net/cjy5myw.js" + }, + "response" : { + "bodySize" : 0, + "content" : { + "mimeType" : "text/javascript;charset=utf-8", + "size" : 7814 + }, + "headers" : [ { + "name" : "status", + "value" : "200" + }, { + "name" : "access-control-allow-origin", + "value" : "*" + }, { + "name" : "cache-control", + "value" : "public, max-age=600, stale-while-revalidate=604800" + }, { + "name" : "content-encoding", + "value" : "gzip" + }, { + "name" : "content-type", + "value" : "text/javascript;charset=utf-8" + }, { + "name" : "server", + "value" : "nginx" + }, { + "name" : "status", + "value" : "200 OK" + }, { + "name" : "timing-allow-origin", + "value" : "*" + }, { + "name" : "vary", + "value" : "Accept-Encoding" + }, { + "name" : "content-length", + "value" : "7814" + }, { + "name" : "date", + "value" : "Sun, 26 Mar 2017 11:58:43 GMT" + } ], + "headersSize" : 334, + "redirectURL" : "", + "status" : 200, + "statusText" : "OK" + }, + "serverIPAddress" : "104.103.103.234", + "startedDateTime" : "2017-03-22T11:58:54.123+02:00", + "time" : 72, + "timings" : { + "blocked" : -1, + "connect" : -1, + "dns" : -1, + "receive" : 10, + "send" : -1, + "ssl" : -1, + "wait" : 62 + } + } ], + "pages" : [ { + "id" : "page_1", + "pageTimings" : { + "onContentLoad" : 874, + "onLoad" : 3492 + }, + "responseCode" : 200, + "startedDateTime" : "2017-03-22T11:58:54.123+02:00", + "title" : "Network Performance Resources | ThousandEyes" + } ], + "version" : "1.2", + "systemMetrics" : { + "startTimeMs" : 1581508857327, + "endTimeMs" : 1581508867333, + "cpuUtilization" : { + "min" : 0.30859375, + "max" : 0.5625, + "mean" : 0.38931831001805056, + "median" : 0.353515625, + "stdDev" : 0.08389194281742307, + "count" : 10 + }, + "physicalMemoryUsedBytes" : { + "min" : 1.2805128192E10, + "max" : 1.2825530368E10, + "mean" : 1.281914582109091E10, + "median" : 1.2818219008E10, + "stdDev" : 5741124.05691331, + "count" : 11 + }, + "physicalMemoryTotalBytes" : 17069891584 + } + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestPageDetailResult.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_real_user_test_results_models_validation(self) -> None: + """Test case for get_real_user_test_results request and response models""" + + response_body_json = """ + { + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "committed" : "2022-07-17T22:00:54Z", + "experienceScore" : 0.5, + "sourceAddress" : "84.255.241.1", + "organizationName" : "T-2 Access Network", + "visitedSite" : "www.thousandeyes.com", + "coordinates" : { + "latitude" : 46.0552778, + "location" : "Slovenia", + "longitude" : 14.5144444 + }, + "network" : { + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "isIcmpBlocked" : true, + "vpnPing" : { + "maxRtt" : 66, + "pktsReceived" : 10, + "avgRtt" : 7, + "meanDevRtt" : 11, + "minRtt" : 1, + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "pktsSent" : 10 + }, + "ping" : { + "maxRtt" : 66, + "pktsReceived" : 10, + "avgRtt" : 7, + "meanDevRtt" : 11, + "minRtt" : 1, + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "pktsSent" : 10 + }, + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "traceroute" : { + "destination" : "13.32.22.232", + "hops" : [ { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + }, { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + } ], + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ] + }, + "vpnTraceroute" : { + "destination" : "13.32.22.232", + "hops" : [ { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + }, { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + } ], + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ] + }, + "connectRtt" : 77.777, + "gatewayPing" : { + "maxRtt" : 66, + "pktsReceived" : 10, + "avgRtt" : 7, + "meanDevRtt" : 11, + "minRtt" : 1, + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "pktsSent" : 10 + }, + "errors" : [ "ping: Request timed out before getting response" ] + }, + "protocol" : "https", + "pages" : [ { + "pageTimings" : { + "onContentLoad" : 1483, + "onLoad" : 4569 + }, + "pageTitle" : "Network Performance Resources | ThousandEyes", + "pageUrl" : "https://app.thousandeyes.com/settings/integrations", + "pageId" : "C31gBrYJ", + "loadDate" : "2022-07-17T22:00:54Z", + "responseCode" : 200 + }, { + "pageTimings" : { + "onContentLoad" : 1483, + "onLoad" : 4569 + }, + "pageTitle" : "Network Performance Resources | ThousandEyes", + "pageUrl" : "https://app.thousandeyes.com/settings/integrations", + "pageId" : "C31gBrYJ", + "loadDate" : "2022-07-17T22:00:54Z", + "responseCode" : 200 + } ], + "numberOfPages" : 2, + "port" : 443, + "browser" : { + "name" : "Google Chrome", + "version" : "116.0.0.0" + }, + "id" : "07625:1490529480:aVDViw0i", + "roundId" : 1384309800 + }, { + "date" : "2022-07-17T22:00:54Z", + "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49", + "committed" : "2022-07-17T22:00:54Z", + "experienceScore" : 0.5, + "sourceAddress" : "84.255.241.1", + "organizationName" : "T-2 Access Network", + "visitedSite" : "www.thousandeyes.com", + "coordinates" : { + "latitude" : 46.0552778, + "location" : "Slovenia", + "longitude" : 14.5144444 + }, + "network" : { + "systemMetrics" : { + "cpuUtilization" : { + "min" : 0.22, + "median" : 0.61, + "max" : 0.75, + "mean" : 0.55, + "count" : 150, + "stdDev" : 0.01 + }, + "physicalMemoryTotalBytes" : 1024, + "startTimeMs" : 1581508857327, + "physicalMemoryUsedBytes" : { + "min" : 1.2, + "median" : 1.85, + "max" : 2.5, + "mean" : 1.77, + "count" : 155, + "stdDev" : 0.25 + }, + "endTimeMs" : 1581508867333 + }, + "isIcmpBlocked" : true, + "vpnPing" : { + "maxRtt" : 66, + "pktsReceived" : 10, + "avgRtt" : 7, + "meanDevRtt" : 11, + "minRtt" : 1, + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "pktsSent" : 10 + }, + "ping" : { + "maxRtt" : 66, + "pktsReceived" : 10, + "avgRtt" : 7, + "meanDevRtt" : 11, + "minRtt" : 1, + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "pktsSent" : 10 + }, + "networkProfile" : { + "previousInterface" : { + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "interfaceName" : "en0", + "subnetMask" : "255.255.255.0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ] + }, + "ethernetProfile" : { + "linkSpeed" : 860 + }, + "publicIpAddress" : "84.255.241.1", + "publicIpRange" : "84.255.241.0-84.255.241.255", + "ipAddress" : "10.0.0.13", + "hardwareType" : "wireless", + "localPrefix" : "10.0.0.0", + "proxyProfile" : { + "method" : "System", + "proxies" : [ { + "bypass" : "*.local;169.254/16", + "proxy" : "" + }, { + "bypass" : "*.local;169.254/16", + "proxy" : "" + } ] + }, + "subnetMask" : "255.255.255.0", + "error" : "An operation timed out.", + "wirelessProfile" : { + "rssi" : -38, + "bssid" : "4c:ba:ba:f4:fa:fa", + "vendor" : "Cisco", + "txRate" : 130, + "channel" : 1, + "noise" : -95, + "phyMode" : "802.11n", + "ssid" : "Internet for the masses", + "quality" : 100 + }, + "interfaceName" : "en0", + "dnsServers" : [ "8.8.8.8", "8.8.8.4" ], + "gateway" : "10.0.0.1" + }, + "traceroute" : { + "destination" : "13.32.22.232", + "hops" : [ { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + }, { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + } ], + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ] + }, + "vpnTraceroute" : { + "destination" : "13.32.22.232", + "hops" : [ { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + }, { + "delay" : 5, + "prefix" : "196.40.96.0/20", + "hop" : 1, + "ipAddress" : "196.40.106.237", + "name" : "89-210-88-65.access.t-2.net", + "mpls" : [ "L=301472,E=0,S=1,T=1" ], + "asn" : 34779 + } ], + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ] + }, + "connectRtt" : 77.777, + "gatewayPing" : { + "maxRtt" : 66, + "pktsReceived" : 10, + "avgRtt" : 7, + "meanDevRtt" : 11, + "minRtt" : 1, + "error" : "An operation timed out.", + "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ], + "pktsSent" : 10 + }, + "errors" : [ "ping: Request timed out before getting response" ] + }, + "protocol" : "https", + "pages" : [ { + "pageTimings" : { + "onContentLoad" : 1483, + "onLoad" : 4569 + }, + "pageTitle" : "Network Performance Resources | ThousandEyes", + "pageUrl" : "https://app.thousandeyes.com/settings/integrations", + "pageId" : "C31gBrYJ", + "loadDate" : "2022-07-17T22:00:54Z", + "responseCode" : 200 + }, { + "pageTimings" : { + "onContentLoad" : 1483, + "onLoad" : 4569 + }, + "pageTitle" : "Network Performance Resources | ThousandEyes", + "pageUrl" : "https://app.thousandeyes.com/settings/integrations", + "pageId" : "C31gBrYJ", + "loadDate" : "2022-07-17T22:00:54Z", + "responseCode" : 200 + } ], + "numberOfPages" : 2, + "port" : 443, + "browser" : { + "name" : "Google Chrome", + "version" : "116.0.0.0" + }, + "id" : "07625:1490529480:aVDViw0i", + "roundId" : 1384309800 + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestDetailResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-endpoint-tests/.openapi-generator/FILES b/thousandeyes-sdk-endpoint-tests/.openapi-generator/FILES index 0a279384b..0da7ad995 100644 --- a/thousandeyes-sdk-endpoint-tests/.openapi-generator/FILES +++ b/thousandeyes-sdk-endpoint-tests/.openapi-generator/FILES @@ -1,16 +1,13 @@ .openapi-generator-ignore MANIFEST.in README.md -docs/AlertDirection.md -docs/AlertRoundsViolationMode.md -docs/AlertRule.md -docs/AlertType.md +docs/AgentToServerEndpointDynamicTestsApi.md +docs/AgentToServerEndpointScheduledTestsApi.md docs/DynamicTest.md docs/DynamicTestLinks.md docs/DynamicTestRequest.md docs/DynamicTestSelfLink.md docs/DynamicTests.md -docs/DynamicTestsAgentToServerApi.md docs/EndpointAgentLabelsSelectorConfig.md docs/EndpointAgentSelectorConfig.md docs/EndpointAgentToServerInstantTest.md @@ -28,6 +25,7 @@ docs/EndpointHttpTestUpdate.md docs/EndpointInstantTest.md docs/EndpointNetworkTestUpdate.md docs/EndpointScheduledTestType.md +docs/EndpointScheduledTestsApi.md docs/EndpointSpecificAgentsSelectorConfig.md docs/EndpointTest.md docs/EndpointTestAgentSelectorType.md @@ -37,13 +35,9 @@ docs/EndpointTestProtocol.md docs/EndpointTestSelfLink.md docs/EndpointTests.md docs/Error.md +docs/HTTPServerEndpointScheduledTestsApi.md docs/Link.md -docs/ListEndpointScheduledTestsApi.md -docs/ScheduledTestsAgentToServerApi.md -docs/ScheduledTestsHTTPServerApi.md docs/SelfLinks.md -docs/SensitivityLevel.md -docs/Severity.md docs/TestInterval.md docs/TestLabel.md docs/TestProbeMode.md @@ -57,15 +51,11 @@ pyproject.toml setup.cfg src/thousandeyes_sdk/endpoint_tests/__init__.py src/thousandeyes_sdk/endpoint_tests/api/__init__.py -src/thousandeyes_sdk/endpoint_tests/api/dynamic_tests_agent_to_server_api.py -src/thousandeyes_sdk/endpoint_tests/api/list_endpoint_scheduled_tests_api.py -src/thousandeyes_sdk/endpoint_tests/api/scheduled_tests_agent_to_server_api.py -src/thousandeyes_sdk/endpoint_tests/api/scheduled_tests_http_server_api.py +src/thousandeyes_sdk/endpoint_tests/api/agent_to_server_endpoint_dynamic_tests_api.py +src/thousandeyes_sdk/endpoint_tests/api/agent_to_server_endpoint_scheduled_tests_api.py +src/thousandeyes_sdk/endpoint_tests/api/endpoint_scheduled_tests_api.py +src/thousandeyes_sdk/endpoint_tests/api/http_server_endpoint_scheduled_tests_api.py src/thousandeyes_sdk/endpoint_tests/models/__init__.py -src/thousandeyes_sdk/endpoint_tests/models/alert_direction.py -src/thousandeyes_sdk/endpoint_tests/models/alert_rounds_violation_mode.py -src/thousandeyes_sdk/endpoint_tests/models/alert_rule.py -src/thousandeyes_sdk/endpoint_tests/models/alert_type.py src/thousandeyes_sdk/endpoint_tests/models/dynamic_test.py src/thousandeyes_sdk/endpoint_tests/models/dynamic_test_links.py src/thousandeyes_sdk/endpoint_tests/models/dynamic_test_request.py @@ -99,8 +89,6 @@ src/thousandeyes_sdk/endpoint_tests/models/endpoint_tests.py src/thousandeyes_sdk/endpoint_tests/models/error.py src/thousandeyes_sdk/endpoint_tests/models/link.py src/thousandeyes_sdk/endpoint_tests/models/self_links.py -src/thousandeyes_sdk/endpoint_tests/models/sensitivity_level.py -src/thousandeyes_sdk/endpoint_tests/models/severity.py src/thousandeyes_sdk/endpoint_tests/models/test_interval.py src/thousandeyes_sdk/endpoint_tests/models/test_label.py src/thousandeyes_sdk/endpoint_tests/models/test_probe_mode.py @@ -112,8 +100,8 @@ src/thousandeyes_sdk/endpoint_tests/models/validation_error.py src/thousandeyes_sdk/endpoint_tests/models/validation_error_item.py src/thousandeyes_sdk/endpoint_tests/py.typed test/__init__.py -test/test_dynamic_tests_agent_to_server_api.py -test/test_list_endpoint_scheduled_tests_api.py -test/test_scheduled_tests_agent_to_server_api.py -test/test_scheduled_tests_http_server_api.py +test/test_agent_to_server_endpoint_dynamic_tests_api.py +test/test_agent_to_server_endpoint_scheduled_tests_api.py +test/test_endpoint_scheduled_tests_api.py +test/test_http_server_endpoint_scheduled_tests_api.py test/test_utils.py diff --git a/thousandeyes-sdk-endpoint-tests/README.md b/thousandeyes-sdk-endpoint-tests/README.md index e21e3dc0f..89775d22b 100644 --- a/thousandeyes-sdk-endpoint-tests/README.md +++ b/thousandeyes-sdk-endpoint-tests/README.md @@ -5,7 +5,7 @@ Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -77,17 +77,17 @@ configuration = thousandeyes_sdk.core.Configuration( # Enter a context with an instance of the API client with thousandeyes_sdk.core.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.endpoint_tests.DynamicTestsAgentToServerApi(api_client) + api_instance = thousandeyes_sdk.endpoint_tests.AgentToServerEndpointDynamicTestsApi(api_client) dynamic_test_request = thousandeyes_sdk.endpoint_tests.DynamicTestRequest() # DynamicTestRequest | aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) try: # Create endpoint dynamic test api_response = api_instance.create_agent_to_server_endpoint_dynamic_test(dynamic_test_request, aid=aid) - print("The response of DynamicTestsAgentToServerApi->create_agent_to_server_endpoint_dynamic_test:\n") + print("The response of AgentToServerEndpointDynamicTestsApi->create_agent_to_server_endpoint_dynamic_test:\n") pprint(api_response) except ApiException as e: - print("Exception when calling DynamicTestsAgentToServerApi->create_agent_to_server_endpoint_dynamic_test: %s\n" % e) + print("Exception when calling AgentToServerEndpointDynamicTestsApi->create_agent_to_server_endpoint_dynamic_test: %s\n" % e) ``` @@ -97,30 +97,26 @@ All URIs are relative to *https://api.thousandeyes.com/v7* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*DynamicTestsAgentToServerApi* | [**create_agent_to_server_endpoint_dynamic_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/DynamicTestsAgentToServerApi.md#create_agent_to_server_endpoint_dynamic_test) | **POST** /endpoint/tests/dynamic-tests/agent-to-server | Create endpoint dynamic test -*DynamicTestsAgentToServerApi* | [**delete_agent_to_server_endpoint_dynamic_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/DynamicTestsAgentToServerApi.md#delete_agent_to_server_endpoint_dynamic_test) | **DELETE** /endpoint/tests/dynamic-tests/agent-to-server/{testId} | Delete agent to server dynamic test -*DynamicTestsAgentToServerApi* | [**get_agent_to_server_endpoint_dynamic_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/DynamicTestsAgentToServerApi.md#get_agent_to_server_endpoint_dynamic_test) | **GET** /endpoint/tests/dynamic-tests/agent-to-server/{testId} | Retrieve endpoint dynamic test -*DynamicTestsAgentToServerApi* | [**get_agent_to_server_endpoint_dynamic_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/DynamicTestsAgentToServerApi.md#get_agent_to_server_endpoint_dynamic_tests) | **GET** /endpoint/tests/dynamic-tests/agent-to-server | List endpoint dynamic tests -*DynamicTestsAgentToServerApi* | [**update_agent_to_server_endpoint_dynamic_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/DynamicTestsAgentToServerApi.md#update_agent_to_server_endpoint_dynamic_test) | **PATCH** /endpoint/tests/dynamic-tests/agent-to-server/{testId} | Update agent to server dynamic test -*ListEndpointScheduledTestsApi* | [**get_endpoint_scheduled_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/ListEndpointScheduledTestsApi.md#get_endpoint_scheduled_tests) | **GET** /endpoint/tests/scheduled-tests | List endpoint scheduled tests -*ScheduledTestsAgentToServerApi* | [**create_agent_to_server_endpoint_scheduled_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/ScheduledTestsAgentToServerApi.md#create_agent_to_server_endpoint_scheduled_test) | **POST** /endpoint/tests/scheduled-tests/agent-to-server | Creates agent to server endpoint scheduled test -*ScheduledTestsAgentToServerApi* | [**delete_agent_to_server_endpoint_scheduled_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/ScheduledTestsAgentToServerApi.md#delete_agent_to_server_endpoint_scheduled_test) | **DELETE** /endpoint/tests/scheduled-tests/agent-to-server/{testId} | Delete agent to server scheduled test -*ScheduledTestsAgentToServerApi* | [**get_agent_to_server_endpoint_scheduled_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/ScheduledTestsAgentToServerApi.md#get_agent_to_server_endpoint_scheduled_test) | **GET** /endpoint/tests/scheduled-tests/agent-to-server/{testId} | Retrieve agent to server endpoint scheduled test -*ScheduledTestsAgentToServerApi* | [**get_agent_to_server_endpoint_scheduled_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/ScheduledTestsAgentToServerApi.md#get_agent_to_server_endpoint_scheduled_tests) | **GET** /endpoint/tests/scheduled-tests/agent-to-server | List agent to server endpoint scheduled tests -*ScheduledTestsAgentToServerApi* | [**update_agent_to_server_endpoint_scheduled_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/ScheduledTestsAgentToServerApi.md#update_agent_to_server_endpoint_scheduled_test) | **PATCH** /endpoint/tests/scheduled-tests/agent-to-server/{testId} | Update agent to server endpoint scheduled test -*ScheduledTestsHTTPServerApi* | [**create_http_server_endpoint_scheduled_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/ScheduledTestsHTTPServerApi.md#create_http_server_endpoint_scheduled_test) | **POST** /endpoint/tests/scheduled-tests/http-server | Create HTTP server endpoint scheduled test -*ScheduledTestsHTTPServerApi* | [**delete_http_server_endpoint_scheduled_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/ScheduledTestsHTTPServerApi.md#delete_http_server_endpoint_scheduled_test) | **DELETE** /endpoint/tests/scheduled-tests/http-server/{testId} | Delete HTTP server scheduled test -*ScheduledTestsHTTPServerApi* | [**get_http_server_endpoint_scheduled_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/ScheduledTestsHTTPServerApi.md#get_http_server_endpoint_scheduled_test) | **GET** /endpoint/tests/scheduled-tests/http-server/{testId} | Retrieves HTTP server endpoint scheduled test -*ScheduledTestsHTTPServerApi* | [**get_http_server_endpoint_scheduled_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/ScheduledTestsHTTPServerApi.md#get_http_server_endpoint_scheduled_tests) | **GET** /endpoint/tests/scheduled-tests/http-server | List HTTP server endpoint scheduled tests -*ScheduledTestsHTTPServerApi* | [**update_http_server_endpoint_scheduled_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/ScheduledTestsHTTPServerApi.md#update_http_server_endpoint_scheduled_test) | **PATCH** /endpoint/tests/scheduled-tests/http-server/{testId} | Update HTTP server endpoint scheduled test +*AgentToServerEndpointDynamicTestsApi* | [**create_agent_to_server_endpoint_dynamic_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointDynamicTestsApi.md#create_agent_to_server_endpoint_dynamic_test) | **POST** /endpoint/tests/dynamic-tests/agent-to-server | Create endpoint dynamic test +*AgentToServerEndpointDynamicTestsApi* | [**delete_agent_to_server_endpoint_dynamic_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointDynamicTestsApi.md#delete_agent_to_server_endpoint_dynamic_test) | **DELETE** /endpoint/tests/dynamic-tests/agent-to-server/{testId} | Delete agent to server dynamic test +*AgentToServerEndpointDynamicTestsApi* | [**get_agent_to_server_endpoint_dynamic_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointDynamicTestsApi.md#get_agent_to_server_endpoint_dynamic_test) | **GET** /endpoint/tests/dynamic-tests/agent-to-server/{testId} | Retrieve endpoint dynamic test +*AgentToServerEndpointDynamicTestsApi* | [**get_agent_to_server_endpoint_dynamic_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointDynamicTestsApi.md#get_agent_to_server_endpoint_dynamic_tests) | **GET** /endpoint/tests/dynamic-tests/agent-to-server | List endpoint dynamic tests +*AgentToServerEndpointDynamicTestsApi* | [**update_agent_to_server_endpoint_dynamic_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointDynamicTestsApi.md#update_agent_to_server_endpoint_dynamic_test) | **PATCH** /endpoint/tests/dynamic-tests/agent-to-server/{testId} | Update agent to server dynamic test +*AgentToServerEndpointScheduledTestsApi* | [**create_agent_to_server_endpoint_scheduled_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointScheduledTestsApi.md#create_agent_to_server_endpoint_scheduled_test) | **POST** /endpoint/tests/scheduled-tests/agent-to-server | Creates agent to server endpoint scheduled test +*AgentToServerEndpointScheduledTestsApi* | [**delete_agent_to_server_endpoint_scheduled_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointScheduledTestsApi.md#delete_agent_to_server_endpoint_scheduled_test) | **DELETE** /endpoint/tests/scheduled-tests/agent-to-server/{testId} | Delete agent to server scheduled test +*AgentToServerEndpointScheduledTestsApi* | [**get_agent_to_server_endpoint_scheduled_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointScheduledTestsApi.md#get_agent_to_server_endpoint_scheduled_test) | **GET** /endpoint/tests/scheduled-tests/agent-to-server/{testId} | Retrieve agent to server endpoint scheduled test +*AgentToServerEndpointScheduledTestsApi* | [**get_agent_to_server_endpoint_scheduled_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointScheduledTestsApi.md#get_agent_to_server_endpoint_scheduled_tests) | **GET** /endpoint/tests/scheduled-tests/agent-to-server | List agent to server endpoint scheduled tests +*AgentToServerEndpointScheduledTestsApi* | [**update_agent_to_server_endpoint_scheduled_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointScheduledTestsApi.md#update_agent_to_server_endpoint_scheduled_test) | **PATCH** /endpoint/tests/scheduled-tests/agent-to-server/{testId} | Update agent to server endpoint scheduled test +*EndpointScheduledTestsApi* | [**get_endpoint_scheduled_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/EndpointScheduledTestsApi.md#get_endpoint_scheduled_tests) | **GET** /endpoint/tests/scheduled-tests | List endpoint scheduled tests +*HTTPServerEndpointScheduledTestsApi* | [**create_http_server_endpoint_scheduled_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/HTTPServerEndpointScheduledTestsApi.md#create_http_server_endpoint_scheduled_test) | **POST** /endpoint/tests/scheduled-tests/http-server | Create HTTP server endpoint scheduled test +*HTTPServerEndpointScheduledTestsApi* | [**delete_http_server_endpoint_scheduled_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/HTTPServerEndpointScheduledTestsApi.md#delete_http_server_endpoint_scheduled_test) | **DELETE** /endpoint/tests/scheduled-tests/http-server/{testId} | Delete HTTP server scheduled test +*HTTPServerEndpointScheduledTestsApi* | [**get_http_server_endpoint_scheduled_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/HTTPServerEndpointScheduledTestsApi.md#get_http_server_endpoint_scheduled_test) | **GET** /endpoint/tests/scheduled-tests/http-server/{testId} | Retrieves HTTP server endpoint scheduled test +*HTTPServerEndpointScheduledTestsApi* | [**get_http_server_endpoint_scheduled_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/HTTPServerEndpointScheduledTestsApi.md#get_http_server_endpoint_scheduled_tests) | **GET** /endpoint/tests/scheduled-tests/http-server | List HTTP server endpoint scheduled tests +*HTTPServerEndpointScheduledTestsApi* | [**update_http_server_endpoint_scheduled_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/HTTPServerEndpointScheduledTestsApi.md#update_http_server_endpoint_scheduled_test) | **PATCH** /endpoint/tests/scheduled-tests/http-server/{testId} | Update HTTP server endpoint scheduled test ## Documentation For Models - - [AlertDirection](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/AlertDirection.md) - - [AlertRoundsViolationMode](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/AlertRoundsViolationMode.md) - - [AlertRule](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/AlertRule.md) - - [AlertType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/AlertType.md) - [DynamicTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/DynamicTest.md) - [DynamicTestLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/DynamicTestLinks.md) - [DynamicTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/DynamicTestRequest.md) @@ -154,8 +150,6 @@ Class | Method | HTTP request | Description - [Error](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/Error.md) - [Link](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/Link.md) - [SelfLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/SelfLinks.md) - - [SensitivityLevel](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/SensitivityLevel.md) - - [Severity](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/Severity.md) - [TestInterval](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/TestInterval.md) - [TestLabel](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/TestLabel.md) - [TestProbeMode](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-endpoint-tests/docs/TestProbeMode.md) diff --git a/thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointDynamicTestsApi.md b/thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointDynamicTestsApi.md new file mode 100644 index 000000000..ad81ffba8 --- /dev/null +++ b/thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointDynamicTestsApi.md @@ -0,0 +1,449 @@ +# thousandeyes_sdk.endpoint_tests.AgentToServerEndpointDynamicTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_agent_to_server_endpoint_dynamic_test**](AgentToServerEndpointDynamicTestsApi.md#create_agent_to_server_endpoint_dynamic_test) | **POST** /endpoint/tests/dynamic-tests/agent-to-server | Create endpoint dynamic test +[**delete_agent_to_server_endpoint_dynamic_test**](AgentToServerEndpointDynamicTestsApi.md#delete_agent_to_server_endpoint_dynamic_test) | **DELETE** /endpoint/tests/dynamic-tests/agent-to-server/{testId} | Delete agent to server dynamic test +[**get_agent_to_server_endpoint_dynamic_test**](AgentToServerEndpointDynamicTestsApi.md#get_agent_to_server_endpoint_dynamic_test) | **GET** /endpoint/tests/dynamic-tests/agent-to-server/{testId} | Retrieve endpoint dynamic test +[**get_agent_to_server_endpoint_dynamic_tests**](AgentToServerEndpointDynamicTestsApi.md#get_agent_to_server_endpoint_dynamic_tests) | **GET** /endpoint/tests/dynamic-tests/agent-to-server | List endpoint dynamic tests +[**update_agent_to_server_endpoint_dynamic_test**](AgentToServerEndpointDynamicTestsApi.md#update_agent_to_server_endpoint_dynamic_test) | **PATCH** /endpoint/tests/dynamic-tests/agent-to-server/{testId} | Update agent to server dynamic test + + +# **create_agent_to_server_endpoint_dynamic_test** +> DynamicTest create_agent_to_server_endpoint_dynamic_test(dynamic_test_request, aid=aid) + +Create endpoint dynamic test + +Create a new endpoint dynamic test in ThousandEyes using properties specified in the POST data. Please note that only Account Admins have the authorization to create new tests; regular users are restricted from using POST-based methods. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_tests +from thousandeyes_sdk.endpoint_tests.models.dynamic_test import DynamicTest +from thousandeyes_sdk.endpoint_tests.models.dynamic_test_request import DynamicTestRequest +from thousandeyes_sdk.endpoint_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_tests.AgentToServerEndpointDynamicTestsApi(api_client) + dynamic_test_request = thousandeyes_sdk.endpoint_tests.DynamicTestRequest() # DynamicTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create endpoint dynamic test + api_response = api_instance.create_agent_to_server_endpoint_dynamic_test(dynamic_test_request, aid=aid) + print("The response of AgentToServerEndpointDynamicTestsApi->create_agent_to_server_endpoint_dynamic_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerEndpointDynamicTestsApi->create_agent_to_server_endpoint_dynamic_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dynamic_test_request** | [**DynamicTestRequest**](DynamicTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**DynamicTest**](DynamicTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_agent_to_server_endpoint_dynamic_test** +> delete_agent_to_server_endpoint_dynamic_test(test_id, aid=aid) + +Delete agent to server dynamic test + +Deletes an agent to server endpoint dynamic test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_tests +from thousandeyes_sdk.endpoint_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_tests.AgentToServerEndpointDynamicTestsApi(api_client) + test_id = '584739201' # str | Unique ID of endpoint test. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete agent to server dynamic test + api_instance.delete_agent_to_server_endpoint_dynamic_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling AgentToServerEndpointDynamicTestsApi->delete_agent_to_server_endpoint_dynamic_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Unique ID of endpoint test. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_agent_to_server_endpoint_dynamic_test** +> DynamicTest get_agent_to_server_endpoint_dynamic_test(test_id, aid=aid) + +Retrieve endpoint dynamic test + +Returns details of an endpoint dynamic test, including test type, name, intervals, targets. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_tests +from thousandeyes_sdk.endpoint_tests.models.dynamic_test import DynamicTest +from thousandeyes_sdk.endpoint_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_tests.AgentToServerEndpointDynamicTestsApi(api_client) + test_id = '584739201' # str | Unique ID of endpoint test. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Retrieve endpoint dynamic test + api_response = api_instance.get_agent_to_server_endpoint_dynamic_test(test_id, aid=aid) + print("The response of AgentToServerEndpointDynamicTestsApi->get_agent_to_server_endpoint_dynamic_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerEndpointDynamicTestsApi->get_agent_to_server_endpoint_dynamic_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Unique ID of endpoint test. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**DynamicTest**](DynamicTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_agent_to_server_endpoint_dynamic_tests** +> DynamicTests get_agent_to_server_endpoint_dynamic_tests(aid=aid) + +List endpoint dynamic tests + +Returns a list of all endpoint dynamic tests configured in ThousandEyes. This list does not contain saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_tests +from thousandeyes_sdk.endpoint_tests.models.dynamic_tests import DynamicTests +from thousandeyes_sdk.endpoint_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_tests.AgentToServerEndpointDynamicTestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List endpoint dynamic tests + api_response = api_instance.get_agent_to_server_endpoint_dynamic_tests(aid=aid) + print("The response of AgentToServerEndpointDynamicTestsApi->get_agent_to_server_endpoint_dynamic_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerEndpointDynamicTestsApi->get_agent_to_server_endpoint_dynamic_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**DynamicTests**](DynamicTests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_agent_to_server_endpoint_dynamic_test** +> DynamicTest update_agent_to_server_endpoint_dynamic_test(test_id, endpoint_dynamic_test_update, aid=aid) + +Update agent to server dynamic test + +Updates an agent to server endpoint dynamic test. Includes support for enabling and disabling the test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_tests +from thousandeyes_sdk.endpoint_tests.models.dynamic_test import DynamicTest +from thousandeyes_sdk.endpoint_tests.models.endpoint_dynamic_test_update import EndpointDynamicTestUpdate +from thousandeyes_sdk.endpoint_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_tests.AgentToServerEndpointDynamicTestsApi(api_client) + test_id = '584739201' # str | Unique ID of endpoint test. + endpoint_dynamic_test_update = thousandeyes_sdk.endpoint_tests.EndpointDynamicTestUpdate() # EndpointDynamicTestUpdate | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Update agent to server dynamic test + api_response = api_instance.update_agent_to_server_endpoint_dynamic_test(test_id, endpoint_dynamic_test_update, aid=aid) + print("The response of AgentToServerEndpointDynamicTestsApi->update_agent_to_server_endpoint_dynamic_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerEndpointDynamicTestsApi->update_agent_to_server_endpoint_dynamic_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Unique ID of endpoint test. | + **endpoint_dynamic_test_update** | [**EndpointDynamicTestUpdate**](EndpointDynamicTestUpdate.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**DynamicTest**](DynamicTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointScheduledTestsApi.md b/thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointScheduledTestsApi.md new file mode 100644 index 000000000..c6ca014a4 --- /dev/null +++ b/thousandeyes-sdk-endpoint-tests/docs/AgentToServerEndpointScheduledTestsApi.md @@ -0,0 +1,449 @@ +# thousandeyes_sdk.endpoint_tests.AgentToServerEndpointScheduledTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_agent_to_server_endpoint_scheduled_test**](AgentToServerEndpointScheduledTestsApi.md#create_agent_to_server_endpoint_scheduled_test) | **POST** /endpoint/tests/scheduled-tests/agent-to-server | Creates agent to server endpoint scheduled test +[**delete_agent_to_server_endpoint_scheduled_test**](AgentToServerEndpointScheduledTestsApi.md#delete_agent_to_server_endpoint_scheduled_test) | **DELETE** /endpoint/tests/scheduled-tests/agent-to-server/{testId} | Delete agent to server scheduled test +[**get_agent_to_server_endpoint_scheduled_test**](AgentToServerEndpointScheduledTestsApi.md#get_agent_to_server_endpoint_scheduled_test) | **GET** /endpoint/tests/scheduled-tests/agent-to-server/{testId} | Retrieve agent to server endpoint scheduled test +[**get_agent_to_server_endpoint_scheduled_tests**](AgentToServerEndpointScheduledTestsApi.md#get_agent_to_server_endpoint_scheduled_tests) | **GET** /endpoint/tests/scheduled-tests/agent-to-server | List agent to server endpoint scheduled tests +[**update_agent_to_server_endpoint_scheduled_test**](AgentToServerEndpointScheduledTestsApi.md#update_agent_to_server_endpoint_scheduled_test) | **PATCH** /endpoint/tests/scheduled-tests/agent-to-server/{testId} | Update agent to server endpoint scheduled test + + +# **create_agent_to_server_endpoint_scheduled_test** +> EndpointAgentToServerTest create_agent_to_server_endpoint_scheduled_test(endpoint_agent_to_server_test_request, aid=aid) + +Creates agent to server endpoint scheduled test + +Creates a new endpoint test in ThousandEyes using properties specified in the POST data. Please note that only Account Admins have the authorization to create new tests; regular users are restricted from using POST-based methods. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_tests +from thousandeyes_sdk.endpoint_tests.models.endpoint_agent_to_server_test import EndpointAgentToServerTest +from thousandeyes_sdk.endpoint_tests.models.endpoint_agent_to_server_test_request import EndpointAgentToServerTestRequest +from thousandeyes_sdk.endpoint_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_tests.AgentToServerEndpointScheduledTestsApi(api_client) + endpoint_agent_to_server_test_request = thousandeyes_sdk.endpoint_tests.EndpointAgentToServerTestRequest() # EndpointAgentToServerTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Creates agent to server endpoint scheduled test + api_response = api_instance.create_agent_to_server_endpoint_scheduled_test(endpoint_agent_to_server_test_request, aid=aid) + print("The response of AgentToServerEndpointScheduledTestsApi->create_agent_to_server_endpoint_scheduled_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerEndpointScheduledTestsApi->create_agent_to_server_endpoint_scheduled_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **endpoint_agent_to_server_test_request** | [**EndpointAgentToServerTestRequest**](EndpointAgentToServerTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointAgentToServerTest**](EndpointAgentToServerTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_agent_to_server_endpoint_scheduled_test** +> delete_agent_to_server_endpoint_scheduled_test(test_id, aid=aid) + +Delete agent to server scheduled test + +Deletes an agent to server endpoint scheduled test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_tests +from thousandeyes_sdk.endpoint_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_tests.AgentToServerEndpointScheduledTestsApi(api_client) + test_id = '584739201' # str | Unique ID of endpoint test. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete agent to server scheduled test + api_instance.delete_agent_to_server_endpoint_scheduled_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling AgentToServerEndpointScheduledTestsApi->delete_agent_to_server_endpoint_scheduled_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Unique ID of endpoint test. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_agent_to_server_endpoint_scheduled_test** +> EndpointAgentToServerTest get_agent_to_server_endpoint_scheduled_test(test_id, aid=aid) + +Retrieve agent to server endpoint scheduled test + +Retrieves details of an agent to server endpoint scheduled test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_tests +from thousandeyes_sdk.endpoint_tests.models.endpoint_agent_to_server_test import EndpointAgentToServerTest +from thousandeyes_sdk.endpoint_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_tests.AgentToServerEndpointScheduledTestsApi(api_client) + test_id = '584739201' # str | Unique ID of endpoint test. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Retrieve agent to server endpoint scheduled test + api_response = api_instance.get_agent_to_server_endpoint_scheduled_test(test_id, aid=aid) + print("The response of AgentToServerEndpointScheduledTestsApi->get_agent_to_server_endpoint_scheduled_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerEndpointScheduledTestsApi->get_agent_to_server_endpoint_scheduled_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Unique ID of endpoint test. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointAgentToServerTest**](EndpointAgentToServerTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_agent_to_server_endpoint_scheduled_tests** +> EndpointAgentToServerTests get_agent_to_server_endpoint_scheduled_tests(aid=aid) + +List agent to server endpoint scheduled tests + +Returns a list of all agent to server endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_tests +from thousandeyes_sdk.endpoint_tests.models.endpoint_agent_to_server_tests import EndpointAgentToServerTests +from thousandeyes_sdk.endpoint_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_tests.AgentToServerEndpointScheduledTestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List agent to server endpoint scheduled tests + api_response = api_instance.get_agent_to_server_endpoint_scheduled_tests(aid=aid) + print("The response of AgentToServerEndpointScheduledTestsApi->get_agent_to_server_endpoint_scheduled_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerEndpointScheduledTestsApi->get_agent_to_server_endpoint_scheduled_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointAgentToServerTests**](EndpointAgentToServerTests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_agent_to_server_endpoint_scheduled_test** +> EndpointAgentToServerTest update_agent_to_server_endpoint_scheduled_test(test_id, endpoint_network_test_update, aid=aid) + +Update agent to server endpoint scheduled test + +Updates an agent to server scheduled test. Includes support for enabling and disabling the test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_tests +from thousandeyes_sdk.endpoint_tests.models.endpoint_agent_to_server_test import EndpointAgentToServerTest +from thousandeyes_sdk.endpoint_tests.models.endpoint_network_test_update import EndpointNetworkTestUpdate +from thousandeyes_sdk.endpoint_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_tests.AgentToServerEndpointScheduledTestsApi(api_client) + test_id = '584739201' # str | Unique ID of endpoint test. + endpoint_network_test_update = thousandeyes_sdk.endpoint_tests.EndpointNetworkTestUpdate() # EndpointNetworkTestUpdate | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Update agent to server endpoint scheduled test + api_response = api_instance.update_agent_to_server_endpoint_scheduled_test(test_id, endpoint_network_test_update, aid=aid) + print("The response of AgentToServerEndpointScheduledTestsApi->update_agent_to_server_endpoint_scheduled_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerEndpointScheduledTestsApi->update_agent_to_server_endpoint_scheduled_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Unique ID of endpoint test. | + **endpoint_network_test_update** | [**EndpointNetworkTestUpdate**](EndpointNetworkTestUpdate.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointAgentToServerTest**](EndpointAgentToServerTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-endpoint-tests/docs/DynamicTestRequest.md b/thousandeyes-sdk-endpoint-tests/docs/DynamicTestRequest.md index 588b32d4f..97b68d6e7 100644 --- a/thousandeyes-sdk-endpoint-tests/docs/DynamicTestRequest.md +++ b/thousandeyes-sdk-endpoint-tests/docs/DynamicTestRequest.md @@ -5,27 +5,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] -**links** | [**DynamicTestLinks**](DynamicTestLinks.md) | | [optional] -**agent_selector_config** | [**EndpointAgentSelectorConfig**](EndpointAgentSelectorConfig.md) | | [optional] -**application** | **str** | Which supported application to monitor, can be one of `webex`, `zoom`, `microsoft-teams`. | [optional] -**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] -**interval** | [**TestInterval**](TestInterval.md) | | [optional] -**is_enabled** | **bool** | Indicates if test is enabled. | [optional] [default to True] -**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] -**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] -**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] -**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] -**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] -**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] -**tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] -**test_id** | **str** | Each test is assigned a unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] -**test_name** | **str** | Name of the test. | [optional] -**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] **agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | [optional] **agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] **endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] -**max_machines** | **int** | Maximum number of agents which can execute this test. | [optional] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] +**application** | **str** | Which supported application to monitor, can be one of `webex`, `zoom`, `microsoft-teams`. | +**protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] +**tcp_probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**test_name** | **str** | Name of the test. | +**has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] ## Example diff --git a/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentLabelsSelectorConfig.md b/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentLabelsSelectorConfig.md index 5a68f3d17..989376a2f 100644 --- a/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentLabelsSelectorConfig.md +++ b/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentLabelsSelectorConfig.md @@ -7,7 +7,7 @@ Agent labels selection object. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **agent_selector_type** | **str** | | -**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] **endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] ## Example diff --git a/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentSelectorConfig.md b/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentSelectorConfig.md index 8ba641fce..6d9b4f6ad 100644 --- a/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentSelectorConfig.md +++ b/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentSelectorConfig.md @@ -7,7 +7,7 @@ Agents selection object based on agentSelectorType. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **agent_selector_type** | **str** | | -**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] **endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] **agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] diff --git a/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentToServerInstantTest.md b/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentToServerInstantTest.md index 4bcb8dbad..ddac5130b 100644 --- a/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentToServerInstantTest.md +++ b/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentToServerInstantTest.md @@ -5,15 +5,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | +**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | [optional] **agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] -**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] -**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] **endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] -**max_machines** | **int** | Maximum number of agents which can execute the test. | -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] **test_name** | **str** | Name of the test. | **server_name** | **str** | A server address without a protocol or IP address. | +**port** | **int** | Port number. | [optional] [default to 443] ## Example diff --git a/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentToServerTest.md b/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentToServerTest.md index 40edce285..0c516808e 100644 --- a/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentToServerTest.md +++ b/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentToServerTest.md @@ -15,14 +15,13 @@ Name | Type | Description | Notes **has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] **modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] **protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] **server** | **str** | Target domain name or IP address. | [optional] **test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] **test_name** | **str** | Name of the test. | [optional] **type** | **str** | Type of test being queried. | [readonly] **tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] -**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**port** | **int** | Port number. | [optional] [default to 443] **labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentToServerTestRequest.md b/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentToServerTestRequest.md index ad0b09a96..db2543faa 100644 --- a/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentToServerTestRequest.md +++ b/thousandeyes-sdk-endpoint-tests/docs/EndpointAgentToServerTestRequest.md @@ -5,16 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | +**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | [optional] **agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] -**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] -**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] **endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] -**max_machines** | **int** | Maximum number of agents which can execute the test. | -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] **test_name** | **str** | Name of the test. | **server_name** | **str** | A server address without a protocol or IP address. | -**interval** | [**TestInterval**](TestInterval.md) | | +**port** | **int** | Port number. | [optional] [default to 443] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] **protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] ## Example diff --git a/thousandeyes-sdk-endpoint-tests/docs/EndpointAllAgentsSelectorConfig.md b/thousandeyes-sdk-endpoint-tests/docs/EndpointAllAgentsSelectorConfig.md index 55d6ddc6e..6b6d8610e 100644 --- a/thousandeyes-sdk-endpoint-tests/docs/EndpointAllAgentsSelectorConfig.md +++ b/thousandeyes-sdk-endpoint-tests/docs/EndpointAllAgentsSelectorConfig.md @@ -7,7 +7,7 @@ Any agent selection object. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **agent_selector_type** | **str** | | -**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] ## Example diff --git a/thousandeyes-sdk-endpoint-tests/docs/EndpointHttpServerBaseTest.md b/thousandeyes-sdk-endpoint-tests/docs/EndpointHttpServerBaseTest.md index 6e65d1a68..946039be8 100644 --- a/thousandeyes-sdk-endpoint-tests/docs/EndpointHttpServerBaseTest.md +++ b/thousandeyes-sdk-endpoint-tests/docs/EndpointHttpServerBaseTest.md @@ -7,13 +7,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] **has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] -**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] [default to 5000] **protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] -**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | [optional] **username** | **str** | Username for Basic/NTLM authentication. | [optional] **ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] **tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] -**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] [default to True] +**url** | **str** | The test target URL. | [optional] ## Example diff --git a/thousandeyes-sdk-endpoint-tests/docs/EndpointHttpServerInstantTest.md b/thousandeyes-sdk-endpoint-tests/docs/EndpointHttpServerInstantTest.md index 036fc6d7b..f461a4158 100644 --- a/thousandeyes-sdk-endpoint-tests/docs/EndpointHttpServerInstantTest.md +++ b/thousandeyes-sdk-endpoint-tests/docs/EndpointHttpServerInstantTest.md @@ -5,25 +5,26 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | +**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | [optional] **agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] -**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] -**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] **endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] -**max_machines** | **int** | Maximum number of agents which can execute the test. | -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] **test_name** | **str** | Name of the test. | **auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] **has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] -**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] [default to 5000] **protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] -**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | **username** | **str** | Username for Basic/NTLM authentication. | [optional] -**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] **tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] -**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | -**target_response_time** | **int** | Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red). | +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] [default to True] +**url** | **str** | The test target URL. You can optionally specify the protocol (`http` or `https`). - **Default Protocol:** If no protocol is specified, `https` is used by default. - **Port Number:** To specify a port, append it to the URL with a colon after the hostname or IP address (e.g., `https://example.com:443`). - If no port is specified in the URL, the `port` is determined by either the deprecated `port` field or the default protocol (HTTP: 80, HTTPS: 443). | +**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] +**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**target_response_time** | **int** | Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red). | [optional] [default to 1000] **password** | **str** | Password for Basic/NTLM authentication. | [optional] +**port** | **int** | **(Deprecated)** The port number to use for the test. It's recommended to specify the port directly in the `url` field instead. If this field is set, it will override the default protocol ports (HTTP: 80, HTTPS: 443) and any port specified in the `url`. | [optional] ## Example diff --git a/thousandeyes-sdk-endpoint-tests/docs/EndpointHttpServerTest.md b/thousandeyes-sdk-endpoint-tests/docs/EndpointHttpServerTest.md index b2ccdd472..506eb6a18 100644 --- a/thousandeyes-sdk-endpoint-tests/docs/EndpointHttpServerTest.md +++ b/thousandeyes-sdk-endpoint-tests/docs/EndpointHttpServerTest.md @@ -15,28 +15,24 @@ Name | Type | Description | Notes **has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] **modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] **protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] **server** | **str** | Target domain name or IP address. | [optional] **test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] **test_name** | **str** | Name of the test. | [optional] **type** | **str** | Type of test being queried. | [readonly] **tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] -**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**port** | **int** | Port number. | [optional] [default to 443] **auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] -**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] -**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | [optional] +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] [default to 5000] **username** | **str** | Username for Basic/NTLM authentication. | [optional] **ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] -**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] -**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] [default to True] +**url** | **str** | The test target URL. | [optional] **follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] **http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] -**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] **ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] **use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] -**user_agent** | **str** | User-agent string to be provided during the test. | [optional] **labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-endpoint-tests/docs/EndpointHttpServerTestRequest.md b/thousandeyes-sdk-endpoint-tests/docs/EndpointHttpServerTestRequest.md index 9bf2064f5..cbf92e5c4 100644 --- a/thousandeyes-sdk-endpoint-tests/docs/EndpointHttpServerTestRequest.md +++ b/thousandeyes-sdk-endpoint-tests/docs/EndpointHttpServerTestRequest.md @@ -5,26 +5,27 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | +**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | [optional] **agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] -**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] -**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] **endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] -**max_machines** | **int** | Maximum number of agents which can execute the test. | -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] **test_name** | **str** | Name of the test. | **auth_type** | [**EndpointTestAuthType**](EndpointTestAuthType.md) | | [optional] **has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] -**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | +**http_time_limit** | **int** | Maximum amount of time in milliseconds the agents wait before a request times out. | [optional] [default to 5000] **protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] -**url** | **str** | Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used. | **username** | **str** | Username for Basic/NTLM authentication. | [optional] -**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] **tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] -**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | -**target_response_time** | **int** | Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red). | +**verify_certificate** | **bool** | Flag indicating if a certificate should be verified. | [optional] [default to True] +**url** | **str** | The test target URL. You can optionally specify the protocol (`http` or `https`). - **Default Protocol:** If no protocol is specified, `https` is used by default. - **Port Number:** To specify a port, append it to the URL with a colon after the hostname or IP address (e.g., `https://example.com:443`). - If no port is specified in the URL, the `port` is determined by either the deprecated `port` field or the default protocol (HTTP: 80, HTTPS: 443). | +**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] +**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**target_response_time** | **int** | Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red). | [optional] [default to 1000] **password** | **str** | Password for Basic/NTLM authentication. | [optional] -**interval** | [**TestInterval**](TestInterval.md) | | +**port** | **int** | **(Deprecated)** The port number to use for the test. It's recommended to specify the port directly in the `url` field instead. If this field is set, it will override the default protocol ports (HTTP: 80, HTTPS: 443) and any port specified in the `url`. | [optional] +**interval** | [**TestInterval**](TestInterval.md) | | [optional] ## Example diff --git a/thousandeyes-sdk-endpoint-tests/docs/EndpointInstantTest.md b/thousandeyes-sdk-endpoint-tests/docs/EndpointInstantTest.md index 2ba419475..817ce8c89 100644 --- a/thousandeyes-sdk-endpoint-tests/docs/EndpointInstantTest.md +++ b/thousandeyes-sdk-endpoint-tests/docs/EndpointInstantTest.md @@ -5,13 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | +**agent_selector_type** | [**EndpointTestAgentSelectorType**](EndpointTestAgentSelectorType.md) | | [optional] **agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] -**has_ping** | **bool** | Optional flag indicating if the test should run ping. | [optional] [default to True] -**has_traceroute** | **bool** | Optional flag indicating if the test should run traceroute. | [optional] [default to True] **endpoint_agent_labels** | **List[str]** | List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`. | [optional] -**max_machines** | **int** | Maximum number of agents which can execute the test. | -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] **test_name** | **str** | Name of the test. | ## Example diff --git a/thousandeyes-sdk-endpoint-tests/docs/EndpointScheduledTestsApi.md b/thousandeyes-sdk-endpoint-tests/docs/EndpointScheduledTestsApi.md new file mode 100644 index 000000000..2aa845906 --- /dev/null +++ b/thousandeyes-sdk-endpoint-tests/docs/EndpointScheduledTestsApi.md @@ -0,0 +1,93 @@ +# thousandeyes_sdk.endpoint_tests.EndpointScheduledTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_endpoint_scheduled_tests**](EndpointScheduledTestsApi.md#get_endpoint_scheduled_tests) | **GET** /endpoint/tests/scheduled-tests | List endpoint scheduled tests + + +# **get_endpoint_scheduled_tests** +> EndpointTests get_endpoint_scheduled_tests(aid=aid) + +List endpoint scheduled tests + +Returns a list of all endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_tests +from thousandeyes_sdk.endpoint_tests.models.endpoint_tests import EndpointTests +from thousandeyes_sdk.endpoint_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_tests.EndpointScheduledTestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List endpoint scheduled tests + api_response = api_instance.get_endpoint_scheduled_tests(aid=aid) + print("The response of EndpointScheduledTestsApi->get_endpoint_scheduled_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointScheduledTestsApi->get_endpoint_scheduled_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointTests**](EndpointTests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-endpoint-tests/docs/EndpointSpecificAgentsSelectorConfig.md b/thousandeyes-sdk-endpoint-tests/docs/EndpointSpecificAgentsSelectorConfig.md index f2aebcf20..7ae4ba1f8 100644 --- a/thousandeyes-sdk-endpoint-tests/docs/EndpointSpecificAgentsSelectorConfig.md +++ b/thousandeyes-sdk-endpoint-tests/docs/EndpointSpecificAgentsSelectorConfig.md @@ -7,7 +7,7 @@ Specific agents selection object. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **agent_selector_type** | **str** | | -**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] +**max_machines** | **int** | Maximum number of agents which can execute the test. | [optional] [default to 25] **agents** | **List[str]** | List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`. | [optional] ## Example diff --git a/thousandeyes-sdk-endpoint-tests/docs/EndpointTest.md b/thousandeyes-sdk-endpoint-tests/docs/EndpointTest.md index f0ec3ef26..40e83ffd1 100644 --- a/thousandeyes-sdk-endpoint-tests/docs/EndpointTest.md +++ b/thousandeyes-sdk-endpoint-tests/docs/EndpointTest.md @@ -15,14 +15,13 @@ Name | Type | Description | Notes **has_path_trace_in_session** | **bool** | Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session. | [optional] **modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] -**port** | **int** | Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443). | [optional] **protocol** | [**EndpointTestProtocol**](EndpointTestProtocol.md) | | [optional] **server** | **str** | Target domain name or IP address. | [optional] **test_id** | **str** | Each test is assigned a unique ID to access test data from other endpoints. | [optional] [readonly] **test_name** | **str** | Name of the test. | [optional] **type** | [**EndpointScheduledTestType**](EndpointScheduledTestType.md) | | **tcp_probe_mode** | [**TestProbeModeResponse**](TestProbeModeResponse.md) | | [optional] -**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**port** | **int** | Port number. | [optional] [default to 443] ## Example diff --git a/thousandeyes-sdk-endpoint-tests/docs/HTTPServerEndpointScheduledTestsApi.md b/thousandeyes-sdk-endpoint-tests/docs/HTTPServerEndpointScheduledTestsApi.md new file mode 100644 index 000000000..076c933e0 --- /dev/null +++ b/thousandeyes-sdk-endpoint-tests/docs/HTTPServerEndpointScheduledTestsApi.md @@ -0,0 +1,449 @@ +# thousandeyes_sdk.endpoint_tests.HTTPServerEndpointScheduledTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_http_server_endpoint_scheduled_test**](HTTPServerEndpointScheduledTestsApi.md#create_http_server_endpoint_scheduled_test) | **POST** /endpoint/tests/scheduled-tests/http-server | Create HTTP server endpoint scheduled test +[**delete_http_server_endpoint_scheduled_test**](HTTPServerEndpointScheduledTestsApi.md#delete_http_server_endpoint_scheduled_test) | **DELETE** /endpoint/tests/scheduled-tests/http-server/{testId} | Delete HTTP server scheduled test +[**get_http_server_endpoint_scheduled_test**](HTTPServerEndpointScheduledTestsApi.md#get_http_server_endpoint_scheduled_test) | **GET** /endpoint/tests/scheduled-tests/http-server/{testId} | Retrieves HTTP server endpoint scheduled test +[**get_http_server_endpoint_scheduled_tests**](HTTPServerEndpointScheduledTestsApi.md#get_http_server_endpoint_scheduled_tests) | **GET** /endpoint/tests/scheduled-tests/http-server | List HTTP server endpoint scheduled tests +[**update_http_server_endpoint_scheduled_test**](HTTPServerEndpointScheduledTestsApi.md#update_http_server_endpoint_scheduled_test) | **PATCH** /endpoint/tests/scheduled-tests/http-server/{testId} | Update HTTP server endpoint scheduled test + + +# **create_http_server_endpoint_scheduled_test** +> EndpointHttpServerTest create_http_server_endpoint_scheduled_test(endpoint_http_server_test_request, aid=aid) + +Create HTTP server endpoint scheduled test + +Creates a new HTTP server endpoint test in ThousandEyes, using properties specified in the POST data. Please note that only users with Account Admin privileges have the authorization to create new tests; regular users are restricted from using POST-based methods. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_tests +from thousandeyes_sdk.endpoint_tests.models.endpoint_http_server_test import EndpointHttpServerTest +from thousandeyes_sdk.endpoint_tests.models.endpoint_http_server_test_request import EndpointHttpServerTestRequest +from thousandeyes_sdk.endpoint_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_tests.HTTPServerEndpointScheduledTestsApi(api_client) + endpoint_http_server_test_request = thousandeyes_sdk.endpoint_tests.EndpointHttpServerTestRequest() # EndpointHttpServerTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create HTTP server endpoint scheduled test + api_response = api_instance.create_http_server_endpoint_scheduled_test(endpoint_http_server_test_request, aid=aid) + print("The response of HTTPServerEndpointScheduledTestsApi->create_http_server_endpoint_scheduled_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPServerEndpointScheduledTestsApi->create_http_server_endpoint_scheduled_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **endpoint_http_server_test_request** | [**EndpointHttpServerTestRequest**](EndpointHttpServerTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointHttpServerTest**](EndpointHttpServerTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_http_server_endpoint_scheduled_test** +> delete_http_server_endpoint_scheduled_test(test_id, aid=aid) + +Delete HTTP server scheduled test + +Deletes an HTTP server endpoint scheduled test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_tests +from thousandeyes_sdk.endpoint_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_tests.HTTPServerEndpointScheduledTestsApi(api_client) + test_id = '584739201' # str | Unique ID of endpoint test. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete HTTP server scheduled test + api_instance.delete_http_server_endpoint_scheduled_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling HTTPServerEndpointScheduledTestsApi->delete_http_server_endpoint_scheduled_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Unique ID of endpoint test. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_http_server_endpoint_scheduled_test** +> EndpointHttpServerTest get_http_server_endpoint_scheduled_test(test_id, aid=aid) + +Retrieves HTTP server endpoint scheduled test + +Retrieves details of an HTTP Server endpoint scheduled test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_tests +from thousandeyes_sdk.endpoint_tests.models.endpoint_http_server_test import EndpointHttpServerTest +from thousandeyes_sdk.endpoint_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_tests.HTTPServerEndpointScheduledTestsApi(api_client) + test_id = '584739201' # str | Unique ID of endpoint test. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Retrieves HTTP server endpoint scheduled test + api_response = api_instance.get_http_server_endpoint_scheduled_test(test_id, aid=aid) + print("The response of HTTPServerEndpointScheduledTestsApi->get_http_server_endpoint_scheduled_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPServerEndpointScheduledTestsApi->get_http_server_endpoint_scheduled_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Unique ID of endpoint test. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointHttpServerTest**](EndpointHttpServerTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_http_server_endpoint_scheduled_tests** +> EndpointHttpServerTests get_http_server_endpoint_scheduled_tests(aid=aid) + +List HTTP server endpoint scheduled tests + +Returns a list of agent to server endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_tests +from thousandeyes_sdk.endpoint_tests.models.endpoint_http_server_tests import EndpointHttpServerTests +from thousandeyes_sdk.endpoint_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_tests.HTTPServerEndpointScheduledTestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List HTTP server endpoint scheduled tests + api_response = api_instance.get_http_server_endpoint_scheduled_tests(aid=aid) + print("The response of HTTPServerEndpointScheduledTestsApi->get_http_server_endpoint_scheduled_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPServerEndpointScheduledTestsApi->get_http_server_endpoint_scheduled_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointHttpServerTests**](EndpointHttpServerTests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_http_server_endpoint_scheduled_test** +> EndpointHttpServerTest update_http_server_endpoint_scheduled_test(test_id, endpoint_http_test_update, aid=aid) + +Update HTTP server endpoint scheduled test + +Updates an HTTP server scheduled test. Includes support for enabling and disabling the test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.endpoint_tests +from thousandeyes_sdk.endpoint_tests.models.endpoint_http_server_test import EndpointHttpServerTest +from thousandeyes_sdk.endpoint_tests.models.endpoint_http_test_update import EndpointHttpTestUpdate +from thousandeyes_sdk.endpoint_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.endpoint_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.endpoint_tests.HTTPServerEndpointScheduledTestsApi(api_client) + test_id = '584739201' # str | Unique ID of endpoint test. + endpoint_http_test_update = thousandeyes_sdk.endpoint_tests.EndpointHttpTestUpdate() # EndpointHttpTestUpdate | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Update HTTP server endpoint scheduled test + api_response = api_instance.update_http_server_endpoint_scheduled_test(test_id, endpoint_http_test_update, aid=aid) + print("The response of HTTPServerEndpointScheduledTestsApi->update_http_server_endpoint_scheduled_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPServerEndpointScheduledTestsApi->update_http_server_endpoint_scheduled_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Unique ID of endpoint test. | + **endpoint_http_test_update** | [**EndpointHttpTestUpdate**](EndpointHttpTestUpdate.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**EndpointHttpServerTest**](EndpointHttpServerTest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/__init__.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/__init__.py index 2346d3153..59e103cff 100644 --- a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/__init__.py +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/__init__.py @@ -14,17 +14,13 @@ # import apis into sdk package -from thousandeyes_sdk.endpoint_tests.api.dynamic_tests_agent_to_server_api import DynamicTestsAgentToServerApi -from thousandeyes_sdk.endpoint_tests.api.list_endpoint_scheduled_tests_api import ListEndpointScheduledTestsApi -from thousandeyes_sdk.endpoint_tests.api.scheduled_tests_agent_to_server_api import ScheduledTestsAgentToServerApi -from thousandeyes_sdk.endpoint_tests.api.scheduled_tests_http_server_api import ScheduledTestsHTTPServerApi +from thousandeyes_sdk.endpoint_tests.api.agent_to_server_endpoint_dynamic_tests_api import AgentToServerEndpointDynamicTestsApi +from thousandeyes_sdk.endpoint_tests.api.agent_to_server_endpoint_scheduled_tests_api import AgentToServerEndpointScheduledTestsApi +from thousandeyes_sdk.endpoint_tests.api.endpoint_scheduled_tests_api import EndpointScheduledTestsApi +from thousandeyes_sdk.endpoint_tests.api.http_server_endpoint_scheduled_tests_api import HTTPServerEndpointScheduledTestsApi # import models into sdk package -from thousandeyes_sdk.endpoint_tests.models.alert_direction import AlertDirection -from thousandeyes_sdk.endpoint_tests.models.alert_rounds_violation_mode import AlertRoundsViolationMode -from thousandeyes_sdk.endpoint_tests.models.alert_rule import AlertRule -from thousandeyes_sdk.endpoint_tests.models.alert_type import AlertType from thousandeyes_sdk.endpoint_tests.models.dynamic_test import DynamicTest from thousandeyes_sdk.endpoint_tests.models.dynamic_test_links import DynamicTestLinks from thousandeyes_sdk.endpoint_tests.models.dynamic_test_request import DynamicTestRequest @@ -58,8 +54,6 @@ from thousandeyes_sdk.endpoint_tests.models.error import Error from thousandeyes_sdk.endpoint_tests.models.link import Link from thousandeyes_sdk.endpoint_tests.models.self_links import SelfLinks -from thousandeyes_sdk.endpoint_tests.models.sensitivity_level import SensitivityLevel -from thousandeyes_sdk.endpoint_tests.models.severity import Severity from thousandeyes_sdk.endpoint_tests.models.test_interval import TestInterval from thousandeyes_sdk.endpoint_tests.models.test_label import TestLabel from thousandeyes_sdk.endpoint_tests.models.test_probe_mode import TestProbeMode diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/__init__.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/__init__.py index d2f3a1ebb..e248e6f41 100644 --- a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/__init__.py +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/__init__.py @@ -1,8 +1,8 @@ # flake8: noqa # import apis into api package -from thousandeyes_sdk.endpoint_tests.api.dynamic_tests_agent_to_server_api import DynamicTestsAgentToServerApi -from thousandeyes_sdk.endpoint_tests.api.list_endpoint_scheduled_tests_api import ListEndpointScheduledTestsApi -from thousandeyes_sdk.endpoint_tests.api.scheduled_tests_agent_to_server_api import ScheduledTestsAgentToServerApi -from thousandeyes_sdk.endpoint_tests.api.scheduled_tests_http_server_api import ScheduledTestsHTTPServerApi +from thousandeyes_sdk.endpoint_tests.api.agent_to_server_endpoint_dynamic_tests_api import AgentToServerEndpointDynamicTestsApi +from thousandeyes_sdk.endpoint_tests.api.agent_to_server_endpoint_scheduled_tests_api import AgentToServerEndpointScheduledTestsApi +from thousandeyes_sdk.endpoint_tests.api.endpoint_scheduled_tests_api import EndpointScheduledTestsApi +from thousandeyes_sdk.endpoint_tests.api.http_server_endpoint_scheduled_tests_api import HTTPServerEndpointScheduledTestsApi diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/agent_to_server_endpoint_dynamic_tests_api.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/agent_to_server_endpoint_dynamic_tests_api.py new file mode 100644 index 000000000..01d36acfe --- /dev/null +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/agent_to_server_endpoint_dynamic_tests_api.py @@ -0,0 +1,1561 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.endpoint_tests.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.endpoint_tests.models.dynamic_test import DynamicTest +from thousandeyes_sdk.endpoint_tests.models.dynamic_test_request import DynamicTestRequest +from thousandeyes_sdk.endpoint_tests.models.dynamic_tests import DynamicTests +from thousandeyes_sdk.endpoint_tests.models.endpoint_dynamic_test_update import EndpointDynamicTestUpdate + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class AgentToServerEndpointDynamicTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-endpoint-tests")) + self.api_client = api_client + + + @validate_call + def create_agent_to_server_endpoint_dynamic_test( + self, + dynamic_test_request: DynamicTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DynamicTest: + """Create endpoint dynamic test + + Create a new endpoint dynamic test in ThousandEyes using properties specified in the POST data. Please note that only Account Admins have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param dynamic_test_request: (required) + :type dynamic_test_request: DynamicTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_server_endpoint_dynamic_test_serialize( + dynamic_test_request=dynamic_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DynamicTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ).data + + + @validate_call + def create_agent_to_server_endpoint_dynamic_test_with_http_info( + self, + dynamic_test_request: DynamicTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DynamicTest]: + """Create endpoint dynamic test + + Create a new endpoint dynamic test in ThousandEyes using properties specified in the POST data. Please note that only Account Admins have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param dynamic_test_request: (required) + :type dynamic_test_request: DynamicTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_server_endpoint_dynamic_test_serialize( + dynamic_test_request=dynamic_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DynamicTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ) + + + @validate_call + def create_agent_to_server_endpoint_dynamic_test_without_preload_content( + self, + dynamic_test_request: DynamicTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create endpoint dynamic test + + Create a new endpoint dynamic test in ThousandEyes using properties specified in the POST data. Please note that only Account Admins have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param dynamic_test_request: (required) + :type dynamic_test_request: DynamicTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_server_endpoint_dynamic_test_serialize( + dynamic_test_request=dynamic_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DynamicTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_agent_to_server_endpoint_dynamic_test_serialize( + self, + dynamic_test_request, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if dynamic_test_request is not None: + _body_params = dynamic_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/tests/dynamic-tests/agent-to-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_agent_to_server_endpoint_dynamic_test( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete agent to server dynamic test + + Deletes an agent to server endpoint dynamic test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_agent_to_server_endpoint_dynamic_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ).data + + + @validate_call + def delete_agent_to_server_endpoint_dynamic_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete agent to server dynamic test + + Deletes an agent to server endpoint dynamic test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_agent_to_server_endpoint_dynamic_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ) + + + @validate_call + def delete_agent_to_server_endpoint_dynamic_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete agent to server dynamic test + + Deletes an agent to server endpoint dynamic test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_agent_to_server_endpoint_dynamic_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_agent_to_server_endpoint_dynamic_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/endpoint/tests/dynamic-tests/agent-to-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_agent_to_server_endpoint_dynamic_test( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DynamicTest: + """Retrieve endpoint dynamic test + + Returns details of an endpoint dynamic test, including test type, name, intervals, targets. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_endpoint_dynamic_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DynamicTest", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ).data + + + @validate_call + def get_agent_to_server_endpoint_dynamic_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DynamicTest]: + """Retrieve endpoint dynamic test + + Returns details of an endpoint dynamic test, including test type, name, intervals, targets. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_endpoint_dynamic_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DynamicTest", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ) + + + @validate_call + def get_agent_to_server_endpoint_dynamic_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve endpoint dynamic test + + Returns details of an endpoint dynamic test, including test type, name, intervals, targets. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_endpoint_dynamic_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DynamicTest", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_to_server_endpoint_dynamic_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/tests/dynamic-tests/agent-to-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_agent_to_server_endpoint_dynamic_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DynamicTests: + """List endpoint dynamic tests + + Returns a list of all endpoint dynamic tests configured in ThousandEyes. This list does not contain saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_endpoint_dynamic_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DynamicTests", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ).data + + + @validate_call + def get_agent_to_server_endpoint_dynamic_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DynamicTests]: + """List endpoint dynamic tests + + Returns a list of all endpoint dynamic tests configured in ThousandEyes. This list does not contain saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_endpoint_dynamic_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DynamicTests", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ) + + + @validate_call + def get_agent_to_server_endpoint_dynamic_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List endpoint dynamic tests + + Returns a list of all endpoint dynamic tests configured in ThousandEyes. This list does not contain saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_endpoint_dynamic_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DynamicTests", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_to_server_endpoint_dynamic_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/tests/dynamic-tests/agent-to-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_agent_to_server_endpoint_dynamic_test( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + endpoint_dynamic_test_update: EndpointDynamicTestUpdate, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DynamicTest: + """Update agent to server dynamic test + + Updates an agent to server endpoint dynamic test. Includes support for enabling and disabling the test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param endpoint_dynamic_test_update: (required) + :type endpoint_dynamic_test_update: EndpointDynamicTestUpdate + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_agent_to_server_endpoint_dynamic_test_serialize( + test_id=test_id, + endpoint_dynamic_test_update=endpoint_dynamic_test_update, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DynamicTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ).data + + + @validate_call + def update_agent_to_server_endpoint_dynamic_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + endpoint_dynamic_test_update: EndpointDynamicTestUpdate, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DynamicTest]: + """Update agent to server dynamic test + + Updates an agent to server endpoint dynamic test. Includes support for enabling and disabling the test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param endpoint_dynamic_test_update: (required) + :type endpoint_dynamic_test_update: EndpointDynamicTestUpdate + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_agent_to_server_endpoint_dynamic_test_serialize( + test_id=test_id, + endpoint_dynamic_test_update=endpoint_dynamic_test_update, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DynamicTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ) + + + @validate_call + def update_agent_to_server_endpoint_dynamic_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + endpoint_dynamic_test_update: EndpointDynamicTestUpdate, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update agent to server dynamic test + + Updates an agent to server endpoint dynamic test. Includes support for enabling and disabling the test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param endpoint_dynamic_test_update: (required) + :type endpoint_dynamic_test_update: EndpointDynamicTestUpdate + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_agent_to_server_endpoint_dynamic_test_serialize( + test_id=test_id, + endpoint_dynamic_test_update=endpoint_dynamic_test_update, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DynamicTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_agent_to_server_endpoint_dynamic_test_serialize( + self, + test_id, + endpoint_dynamic_test_update, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if endpoint_dynamic_test_update is not None: + _body_params = endpoint_dynamic_test_update + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/endpoint/tests/dynamic-tests/agent-to-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/agent_to_server_endpoint_scheduled_tests_api.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/agent_to_server_endpoint_scheduled_tests_api.py new file mode 100644 index 000000000..42c5de47d --- /dev/null +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/agent_to_server_endpoint_scheduled_tests_api.py @@ -0,0 +1,1561 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.endpoint_tests.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.endpoint_tests.models.endpoint_agent_to_server_test import EndpointAgentToServerTest +from thousandeyes_sdk.endpoint_tests.models.endpoint_agent_to_server_test_request import EndpointAgentToServerTestRequest +from thousandeyes_sdk.endpoint_tests.models.endpoint_agent_to_server_tests import EndpointAgentToServerTests +from thousandeyes_sdk.endpoint_tests.models.endpoint_network_test_update import EndpointNetworkTestUpdate + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class AgentToServerEndpointScheduledTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-endpoint-tests")) + self.api_client = api_client + + + @validate_call + def create_agent_to_server_endpoint_scheduled_test( + self, + endpoint_agent_to_server_test_request: EndpointAgentToServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EndpointAgentToServerTest: + """Creates agent to server endpoint scheduled test + + Creates a new endpoint test in ThousandEyes using properties specified in the POST data. Please note that only Account Admins have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param endpoint_agent_to_server_test_request: (required) + :type endpoint_agent_to_server_test_request: EndpointAgentToServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_server_endpoint_scheduled_test_serialize( + endpoint_agent_to_server_test_request=endpoint_agent_to_server_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointAgentToServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ).data + + + @validate_call + def create_agent_to_server_endpoint_scheduled_test_with_http_info( + self, + endpoint_agent_to_server_test_request: EndpointAgentToServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EndpointAgentToServerTest]: + """Creates agent to server endpoint scheduled test + + Creates a new endpoint test in ThousandEyes using properties specified in the POST data. Please note that only Account Admins have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param endpoint_agent_to_server_test_request: (required) + :type endpoint_agent_to_server_test_request: EndpointAgentToServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_server_endpoint_scheduled_test_serialize( + endpoint_agent_to_server_test_request=endpoint_agent_to_server_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointAgentToServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ) + + + @validate_call + def create_agent_to_server_endpoint_scheduled_test_without_preload_content( + self, + endpoint_agent_to_server_test_request: EndpointAgentToServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Creates agent to server endpoint scheduled test + + Creates a new endpoint test in ThousandEyes using properties specified in the POST data. Please note that only Account Admins have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param endpoint_agent_to_server_test_request: (required) + :type endpoint_agent_to_server_test_request: EndpointAgentToServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_server_endpoint_scheduled_test_serialize( + endpoint_agent_to_server_test_request=endpoint_agent_to_server_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointAgentToServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_agent_to_server_endpoint_scheduled_test_serialize( + self, + endpoint_agent_to_server_test_request, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if endpoint_agent_to_server_test_request is not None: + _body_params = endpoint_agent_to_server_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/tests/scheduled-tests/agent-to-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_agent_to_server_endpoint_scheduled_test( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete agent to server scheduled test + + Deletes an agent to server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_agent_to_server_endpoint_scheduled_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ).data + + + @validate_call + def delete_agent_to_server_endpoint_scheduled_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete agent to server scheduled test + + Deletes an agent to server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_agent_to_server_endpoint_scheduled_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ) + + + @validate_call + def delete_agent_to_server_endpoint_scheduled_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete agent to server scheduled test + + Deletes an agent to server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_agent_to_server_endpoint_scheduled_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_agent_to_server_endpoint_scheduled_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/endpoint/tests/scheduled-tests/agent-to-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_agent_to_server_endpoint_scheduled_test( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EndpointAgentToServerTest: + """Retrieve agent to server endpoint scheduled test + + Retrieves details of an agent to server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_endpoint_scheduled_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentToServerTest", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ).data + + + @validate_call + def get_agent_to_server_endpoint_scheduled_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EndpointAgentToServerTest]: + """Retrieve agent to server endpoint scheduled test + + Retrieves details of an agent to server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_endpoint_scheduled_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentToServerTest", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ) + + + @validate_call + def get_agent_to_server_endpoint_scheduled_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve agent to server endpoint scheduled test + + Retrieves details of an agent to server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_endpoint_scheduled_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentToServerTest", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_to_server_endpoint_scheduled_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/tests/scheduled-tests/agent-to-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_agent_to_server_endpoint_scheduled_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EndpointAgentToServerTests: + """List agent to server endpoint scheduled tests + + Returns a list of all agent to server endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_endpoint_scheduled_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentToServerTests", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ).data + + + @validate_call + def get_agent_to_server_endpoint_scheduled_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EndpointAgentToServerTests]: + """List agent to server endpoint scheduled tests + + Returns a list of all agent to server endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_endpoint_scheduled_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentToServerTests", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ) + + + @validate_call + def get_agent_to_server_endpoint_scheduled_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List agent to server endpoint scheduled tests + + Returns a list of all agent to server endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_endpoint_scheduled_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentToServerTests", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_to_server_endpoint_scheduled_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/tests/scheduled-tests/agent-to-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_agent_to_server_endpoint_scheduled_test( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + endpoint_network_test_update: EndpointNetworkTestUpdate, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EndpointAgentToServerTest: + """Update agent to server endpoint scheduled test + + Updates an agent to server scheduled test. Includes support for enabling and disabling the test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param endpoint_network_test_update: (required) + :type endpoint_network_test_update: EndpointNetworkTestUpdate + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_agent_to_server_endpoint_scheduled_test_serialize( + test_id=test_id, + endpoint_network_test_update=endpoint_network_test_update, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentToServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ).data + + + @validate_call + def update_agent_to_server_endpoint_scheduled_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + endpoint_network_test_update: EndpointNetworkTestUpdate, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EndpointAgentToServerTest]: + """Update agent to server endpoint scheduled test + + Updates an agent to server scheduled test. Includes support for enabling and disabling the test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param endpoint_network_test_update: (required) + :type endpoint_network_test_update: EndpointNetworkTestUpdate + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_agent_to_server_endpoint_scheduled_test_serialize( + test_id=test_id, + endpoint_network_test_update=endpoint_network_test_update, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentToServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ) + + + @validate_call + def update_agent_to_server_endpoint_scheduled_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + endpoint_network_test_update: EndpointNetworkTestUpdate, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update agent to server endpoint scheduled test + + Updates an agent to server scheduled test. Includes support for enabling and disabling the test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param endpoint_network_test_update: (required) + :type endpoint_network_test_update: EndpointNetworkTestUpdate + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_agent_to_server_endpoint_scheduled_test_serialize( + test_id=test_id, + endpoint_network_test_update=endpoint_network_test_update, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointAgentToServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_agent_to_server_endpoint_scheduled_test_serialize( + self, + test_id, + endpoint_network_test_update, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if endpoint_network_test_update is not None: + _body_params = endpoint_network_test_update + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/endpoint/tests/scheduled-tests/agent-to-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/endpoint_scheduled_tests_api.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/endpoint_scheduled_tests_api.py new file mode 100644 index 000000000..41cb9ce65 --- /dev/null +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/endpoint_scheduled_tests_api.py @@ -0,0 +1,321 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.endpoint_tests.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.endpoint_tests.models.endpoint_tests import EndpointTests + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class EndpointScheduledTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-endpoint-tests")) + self.api_client = api_client + + + @validate_call + def get_endpoint_scheduled_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EndpointTests: + """List endpoint scheduled tests + + Returns a list of all endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_scheduled_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointTests", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ).data + + + @validate_call + def get_endpoint_scheduled_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EndpointTests]: + """List endpoint scheduled tests + + Returns a list of all endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_scheduled_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointTests", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ) + + + @validate_call + def get_endpoint_scheduled_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List endpoint scheduled tests + + Returns a list of all endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_scheduled_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointTests", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_endpoint_scheduled_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/tests/scheduled-tests', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/http_server_endpoint_scheduled_tests_api.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/http_server_endpoint_scheduled_tests_api.py new file mode 100644 index 000000000..f3a2993bc --- /dev/null +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/api/http_server_endpoint_scheduled_tests_api.py @@ -0,0 +1,1561 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.endpoint_tests.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.endpoint_tests.models.endpoint_http_server_test import EndpointHttpServerTest +from thousandeyes_sdk.endpoint_tests.models.endpoint_http_server_test_request import EndpointHttpServerTestRequest +from thousandeyes_sdk.endpoint_tests.models.endpoint_http_server_tests import EndpointHttpServerTests +from thousandeyes_sdk.endpoint_tests.models.endpoint_http_test_update import EndpointHttpTestUpdate + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class HTTPServerEndpointScheduledTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-endpoint-tests")) + self.api_client = api_client + + + @validate_call + def create_http_server_endpoint_scheduled_test( + self, + endpoint_http_server_test_request: EndpointHttpServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EndpointHttpServerTest: + """Create HTTP server endpoint scheduled test + + Creates a new HTTP server endpoint test in ThousandEyes, using properties specified in the POST data. Please note that only users with Account Admin privileges have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param endpoint_http_server_test_request: (required) + :type endpoint_http_server_test_request: EndpointHttpServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_http_server_endpoint_scheduled_test_serialize( + endpoint_http_server_test_request=endpoint_http_server_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointHttpServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ).data + + + @validate_call + def create_http_server_endpoint_scheduled_test_with_http_info( + self, + endpoint_http_server_test_request: EndpointHttpServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EndpointHttpServerTest]: + """Create HTTP server endpoint scheduled test + + Creates a new HTTP server endpoint test in ThousandEyes, using properties specified in the POST data. Please note that only users with Account Admin privileges have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param endpoint_http_server_test_request: (required) + :type endpoint_http_server_test_request: EndpointHttpServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_http_server_endpoint_scheduled_test_serialize( + endpoint_http_server_test_request=endpoint_http_server_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointHttpServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ) + + + @validate_call + def create_http_server_endpoint_scheduled_test_without_preload_content( + self, + endpoint_http_server_test_request: EndpointHttpServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create HTTP server endpoint scheduled test + + Creates a new HTTP server endpoint test in ThousandEyes, using properties specified in the POST data. Please note that only users with Account Admin privileges have the authorization to create new tests; regular users are restricted from using POST-based methods. + + :param endpoint_http_server_test_request: (required) + :type endpoint_http_server_test_request: EndpointHttpServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_http_server_endpoint_scheduled_test_serialize( + endpoint_http_server_test_request=endpoint_http_server_test_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "EndpointHttpServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_http_server_endpoint_scheduled_test_serialize( + self, + endpoint_http_server_test_request, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if endpoint_http_server_test_request is not None: + _body_params = endpoint_http_server_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/endpoint/tests/scheduled-tests/http-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_http_server_endpoint_scheduled_test( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete HTTP server scheduled test + + Deletes an HTTP server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_http_server_endpoint_scheduled_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ).data + + + @validate_call + def delete_http_server_endpoint_scheduled_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete HTTP server scheduled test + + Deletes an HTTP server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_http_server_endpoint_scheduled_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ) + + + @validate_call + def delete_http_server_endpoint_scheduled_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete HTTP server scheduled test + + Deletes an HTTP server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_http_server_endpoint_scheduled_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_http_server_endpoint_scheduled_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/endpoint/tests/scheduled-tests/http-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_http_server_endpoint_scheduled_test( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EndpointHttpServerTest: + """Retrieves HTTP server endpoint scheduled test + + Retrieves details of an HTTP Server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_http_server_endpoint_scheduled_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointHttpServerTest", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ).data + + + @validate_call + def get_http_server_endpoint_scheduled_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EndpointHttpServerTest]: + """Retrieves HTTP server endpoint scheduled test + + Retrieves details of an HTTP Server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_http_server_endpoint_scheduled_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointHttpServerTest", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ) + + + @validate_call + def get_http_server_endpoint_scheduled_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieves HTTP server endpoint scheduled test + + Retrieves details of an HTTP Server endpoint scheduled test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_http_server_endpoint_scheduled_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointHttpServerTest", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_http_server_endpoint_scheduled_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/tests/scheduled-tests/http-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_http_server_endpoint_scheduled_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EndpointHttpServerTests: + """List HTTP server endpoint scheduled tests + + Returns a list of agent to server endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_http_server_endpoint_scheduled_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointHttpServerTests", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ).data + + + @validate_call + def get_http_server_endpoint_scheduled_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EndpointHttpServerTests]: + """List HTTP server endpoint scheduled tests + + Returns a list of agent to server endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_http_server_endpoint_scheduled_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointHttpServerTests", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ) + + + @validate_call + def get_http_server_endpoint_scheduled_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List HTTP server endpoint scheduled tests + + Returns a list of agent to server endpoint scheduled tests configured in ThousandEyes. This list does not contain saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_http_server_endpoint_scheduled_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointHttpServerTests", + '401': "UnauthorizedError", + '403': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_http_server_endpoint_scheduled_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/endpoint/tests/scheduled-tests/http-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_http_server_endpoint_scheduled_test( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + endpoint_http_test_update: EndpointHttpTestUpdate, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EndpointHttpServerTest: + """Update HTTP server endpoint scheduled test + + Updates an HTTP server scheduled test. Includes support for enabling and disabling the test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param endpoint_http_test_update: (required) + :type endpoint_http_test_update: EndpointHttpTestUpdate + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_http_server_endpoint_scheduled_test_serialize( + test_id=test_id, + endpoint_http_test_update=endpoint_http_test_update, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointHttpServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ).data + + + @validate_call + def update_http_server_endpoint_scheduled_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + endpoint_http_test_update: EndpointHttpTestUpdate, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EndpointHttpServerTest]: + """Update HTTP server endpoint scheduled test + + Updates an HTTP server scheduled test. Includes support for enabling and disabling the test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param endpoint_http_test_update: (required) + :type endpoint_http_test_update: EndpointHttpTestUpdate + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_http_server_endpoint_scheduled_test_serialize( + test_id=test_id, + endpoint_http_test_update=endpoint_http_test_update, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointHttpServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.endpoint_tests.models, + ) + + + @validate_call + def update_http_server_endpoint_scheduled_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Unique ID of endpoint test.")], + endpoint_http_test_update: EndpointHttpTestUpdate, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update HTTP server endpoint scheduled test + + Updates an HTTP server scheduled test. Includes support for enabling and disabling the test. + + :param test_id: Unique ID of endpoint test. (required) + :type test_id: str + :param endpoint_http_test_update: (required) + :type endpoint_http_test_update: EndpointHttpTestUpdate + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_http_server_endpoint_scheduled_test_serialize( + test_id=test_id, + endpoint_http_test_update=endpoint_http_test_update, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointHttpServerTest", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_http_server_endpoint_scheduled_test_serialize( + self, + test_id, + endpoint_http_test_update, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if endpoint_http_test_update is not None: + _body_params = endpoint_http_test_update + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/endpoint/tests/scheduled-tests/http-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/__init__.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/__init__.py index 7375866f7..aab4f67ca 100644 --- a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/__init__.py +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/__init__.py @@ -13,10 +13,6 @@ # import models into model package -from thousandeyes_sdk.endpoint_tests.models.alert_direction import AlertDirection -from thousandeyes_sdk.endpoint_tests.models.alert_rounds_violation_mode import AlertRoundsViolationMode -from thousandeyes_sdk.endpoint_tests.models.alert_rule import AlertRule -from thousandeyes_sdk.endpoint_tests.models.alert_type import AlertType from thousandeyes_sdk.endpoint_tests.models.dynamic_test import DynamicTest from thousandeyes_sdk.endpoint_tests.models.dynamic_test_links import DynamicTestLinks from thousandeyes_sdk.endpoint_tests.models.dynamic_test_request import DynamicTestRequest @@ -50,8 +46,6 @@ from thousandeyes_sdk.endpoint_tests.models.error import Error from thousandeyes_sdk.endpoint_tests.models.link import Link from thousandeyes_sdk.endpoint_tests.models.self_links import SelfLinks -from thousandeyes_sdk.endpoint_tests.models.sensitivity_level import SensitivityLevel -from thousandeyes_sdk.endpoint_tests.models.severity import Severity from thousandeyes_sdk.endpoint_tests.models.test_interval import TestInterval from thousandeyes_sdk.endpoint_tests.models.test_label import TestLabel from thousandeyes_sdk.endpoint_tests.models.test_probe_mode import TestProbeMode diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/dynamic_test_request.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/dynamic_test_request.py index 60eb69d15..8de1bc14f 100644 --- a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/dynamic_test_request.py +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/dynamic_test_request.py @@ -16,17 +16,13 @@ import re # noqa: F401 import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.endpoint_tests.models.dynamic_test_links import DynamicTestLinks -from thousandeyes_sdk.endpoint_tests.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig from thousandeyes_sdk.endpoint_tests.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType from thousandeyes_sdk.endpoint_tests.models.endpoint_test_protocol import EndpointTestProtocol from thousandeyes_sdk.endpoint_tests.models.test_interval import TestInterval -from thousandeyes_sdk.endpoint_tests.models.test_label import TestLabel -from thousandeyes_sdk.endpoint_tests.models.test_probe_mode_response import TestProbeModeResponse +from thousandeyes_sdk.endpoint_tests.models.test_probe_mode import TestProbeMode from typing import Optional, Set from typing_extensions import Self @@ -34,28 +30,17 @@ class DynamicTestRequest(BaseModel): """ DynamicTestRequest """ # noqa: E501 - aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") - links: Optional[DynamicTestLinks] = Field(default=None, alias="_links") - agent_selector_config: Optional[EndpointAgentSelectorConfig] = Field(default=None, alias="agentSelectorConfig") - application: Optional[StrictStr] = Field(default=None, description="Which supported application to monitor, can be one of `webex`, `zoom`, `microsoft-teams`.") - created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") - interval: Optional[TestInterval] = None - is_enabled: Optional[StrictBool] = Field(default=True, description="Indicates if test is enabled.", alias="isEnabled") - has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") - has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") - has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") - modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") - network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") - protocol: Optional[EndpointTestProtocol] = None - tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") - test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID; this is used to access test information and results from other endpoints.", alias="testId") - test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") - labels: Optional[List[TestLabel]] = None agent_selector_type: Optional[EndpointTestAgentSelectorType] = Field(default=None, alias="agentSelectorType") agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") - max_machines: Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute this test.", alias="maxMachines") - __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "application", "createdDate", "interval", "isEnabled", "hasPathTraceInSession", "hasPing", "hasTraceroute", "modifiedDate", "networkMeasurements", "protocol", "tcpProbeMode", "testId", "testName", "labels", "agentSelectorType", "agents", "endpointAgentLabels", "maxMachines"] + interval: Optional[TestInterval] = None + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") + application: StrictStr = Field(description="Which supported application to monitor, can be one of `webex`, `zoom`, `microsoft-teams`.") + protocol: Optional[EndpointTestProtocol] = None + tcp_probe_mode: Optional[TestProbeMode] = Field(default=None, alias="tcpProbeMode") + test_name: StrictStr = Field(description="Name of the test.", alias="testName") + has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") + __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "endpointAgentLabels", "interval", "maxMachines", "application", "protocol", "tcpProbeMode", "testName", "hasPathTraceInSession"] model_config = ConfigDict( populate_by_name=True, @@ -88,16 +73,8 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. - * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ - "created_date", - "modified_date", - "test_id", - "labels", ]) _dict = self.model_dump( @@ -105,19 +82,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of links - if self.links: - _dict['_links'] = self.links.to_dict() - # override the default output from pydantic by calling `to_dict()` of agent_selector_config - if self.agent_selector_config: - _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in labels (list) - _items = [] - if self.labels: - for _item in self.labels: - if _item: - _items.append(_item.to_dict()) - _dict['labels'] = _items return _dict @classmethod @@ -130,27 +94,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "aid": obj.get("aid"), - "_links": DynamicTestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, - "agentSelectorConfig": EndpointAgentSelectorConfig.from_dict(obj["agentSelectorConfig"]) if obj.get("agentSelectorConfig") is not None else None, - "application": obj.get("application"), - "createdDate": obj.get("createdDate"), + "agentSelectorType": obj.get("agentSelectorType"), + "agents": obj.get("agents"), + "endpointAgentLabels": obj.get("endpointAgentLabels"), "interval": obj.get("interval"), - "isEnabled": obj.get("isEnabled") if obj.get("isEnabled") is not None else True, - "hasPathTraceInSession": obj.get("hasPathTraceInSession"), - "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, - "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, - "modifiedDate": obj.get("modifiedDate"), - "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25, + "application": obj.get("application"), "protocol": obj.get("protocol"), "tcpProbeMode": obj.get("tcpProbeMode"), - "testId": obj.get("testId"), "testName": obj.get("testName"), - "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, - "agentSelectorType": obj.get("agentSelectorType"), - "agents": obj.get("agents"), - "endpointAgentLabels": obj.get("endpointAgentLabels"), - "maxMachines": obj.get("maxMachines") + "hasPathTraceInSession": obj.get("hasPathTraceInSession") }) return _obj diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_agent_labels_selector_config.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_agent_labels_selector_config.py index 05890fcb5..321ca7192 100644 --- a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_agent_labels_selector_config.py +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_agent_labels_selector_config.py @@ -27,7 +27,7 @@ class EndpointAgentLabelsSelectorConfig(BaseModel): Agent labels selection object. """ # noqa: E501 agent_selector_type: Annotated[str, Field(strict=True)] = Field(alias="agentSelectorType") - max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines", "endpointAgentLabels"] @@ -91,7 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "agentSelectorType": obj.get("agentSelectorType"), - "maxMachines": obj.get("maxMachines"), + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25, "endpointAgentLabels": obj.get("endpointAgentLabels") }) return _obj diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_agent_to_server_instant_test.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_agent_to_server_instant_test.py index 4572fde4d..0a1171b70 100644 --- a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_agent_to_server_instant_test.py +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_agent_to_server_instant_test.py @@ -16,7 +16,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from thousandeyes_sdk.endpoint_tests.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType @@ -27,16 +27,14 @@ class EndpointAgentToServerInstantTest(BaseModel): """ EndpointAgentToServerInstantTest """ # noqa: E501 - agent_selector_type: EndpointTestAgentSelectorType = Field(alias="agentSelectorType") + agent_selector_type: Optional[EndpointTestAgentSelectorType] = Field(default=None, alias="agentSelectorType") agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") - has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") - has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") - max_machines: Annotated[int, Field(le=50000, strict=True, ge=1)] = Field(description="Maximum number of agents which can execute the test.", alias="maxMachines") - port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") test_name: StrictStr = Field(description="Name of the test.", alias="testName") server_name: StrictStr = Field(description="A server address without a protocol or IP address.", alias="serverName") - __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "hasPing", "hasTraceroute", "endpointAgentLabels", "maxMachines", "port", "testName", "serverName"] + port: Optional[StrictInt] = Field(default=443, description="Port number.") + __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "endpointAgentLabels", "maxMachines", "testName", "serverName", "port"] model_config = ConfigDict( populate_by_name=True, @@ -92,13 +90,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "agentSelectorType": obj.get("agentSelectorType"), "agents": obj.get("agents"), - "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, - "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, "endpointAgentLabels": obj.get("endpointAgentLabels"), - "maxMachines": obj.get("maxMachines"), - "port": obj.get("port"), + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25, "testName": obj.get("testName"), - "serverName": obj.get("serverName") + "serverName": obj.get("serverName"), + "port": obj.get("port") if obj.get("port") is not None else 443 }) return _obj diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_agent_to_server_test.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_agent_to_server_test.py index cc383be57..d2f829f72 100644 --- a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_agent_to_server_test.py +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_agent_to_server_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.endpoint_tests.models.alert_rule import AlertRule from thousandeyes_sdk.endpoint_tests.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig from thousandeyes_sdk.endpoint_tests.models.endpoint_test_links import EndpointTestLinks from thousandeyes_sdk.endpoint_tests.models.endpoint_test_protocol import EndpointTestProtocol @@ -44,16 +43,15 @@ class EndpointAgentToServerTest(BaseModel): has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") - port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") protocol: Optional[EndpointTestProtocol] = None server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") type: Annotated[str, Field(strict=True)] = Field(description="Type of test being queried.") tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") - alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + port: Optional[StrictInt] = Field(default=443, description="Port number.") labels: Optional[List[TestLabel]] = None - __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "alertRules", "labels"] + __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "port", "labels"] @field_validator('type') def type_validate_regular_expression(cls, value): @@ -120,13 +118,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of agent_selector_config if self.agent_selector_config: _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) - _items = [] - if self.alert_rules: - for _item in self.alert_rules: - if _item: - _items.append(_item.to_dict()) - _dict['alertRules'] = _items # override the default output from pydantic by calling `to_dict()` of each item in labels (list) _items = [] if self.labels: @@ -156,14 +147,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "hasPathTraceInSession": obj.get("hasPathTraceInSession"), "modifiedDate": obj.get("modifiedDate"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, - "port": obj.get("port"), "protocol": obj.get("protocol"), "server": obj.get("server"), "testId": obj.get("testId"), "testName": obj.get("testName"), "type": obj.get("type"), "tcpProbeMode": obj.get("tcpProbeMode"), - "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "port": obj.get("port") if obj.get("port") is not None else 443, "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None }) return _obj diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_agent_to_server_test_request.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_agent_to_server_test_request.py index 15cd25b15..0951385f6 100644 --- a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_agent_to_server_test_request.py +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_agent_to_server_test_request.py @@ -16,7 +16,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from thousandeyes_sdk.endpoint_tests.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType @@ -29,18 +29,16 @@ class EndpointAgentToServerTestRequest(BaseModel): """ EndpointAgentToServerTestRequest """ # noqa: E501 - agent_selector_type: EndpointTestAgentSelectorType = Field(alias="agentSelectorType") + agent_selector_type: Optional[EndpointTestAgentSelectorType] = Field(default=None, alias="agentSelectorType") agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") - has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") - has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") - max_machines: Annotated[int, Field(le=50000, strict=True, ge=1)] = Field(description="Maximum number of agents which can execute the test.", alias="maxMachines") - port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") test_name: StrictStr = Field(description="Name of the test.", alias="testName") server_name: StrictStr = Field(description="A server address without a protocol or IP address.", alias="serverName") - interval: TestInterval + port: Optional[StrictInt] = Field(default=443, description="Port number.") + interval: Optional[TestInterval] = None protocol: Optional[EndpointTestProtocol] = None - __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "hasPing", "hasTraceroute", "endpointAgentLabels", "maxMachines", "port", "testName", "serverName", "interval", "protocol"] + __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "endpointAgentLabels", "maxMachines", "testName", "serverName", "port", "interval", "protocol"] model_config = ConfigDict( populate_by_name=True, @@ -96,13 +94,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "agentSelectorType": obj.get("agentSelectorType"), "agents": obj.get("agents"), - "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, - "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, "endpointAgentLabels": obj.get("endpointAgentLabels"), - "maxMachines": obj.get("maxMachines"), - "port": obj.get("port"), + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25, "testName": obj.get("testName"), "serverName": obj.get("serverName"), + "port": obj.get("port") if obj.get("port") is not None else 443, "interval": obj.get("interval"), "protocol": obj.get("protocol") }) diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_all_agents_selector_config.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_all_agents_selector_config.py index 05d9a5d5b..29f3b2dab 100644 --- a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_all_agents_selector_config.py +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_all_agents_selector_config.py @@ -27,7 +27,7 @@ class EndpointAllAgentsSelectorConfig(BaseModel): Any agent selection object. """ # noqa: E501 agent_selector_type: Annotated[str, Field(strict=True)] = Field(alias="agentSelectorType") - max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines"] @field_validator('agent_selector_type') @@ -90,7 +90,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "agentSelectorType": obj.get("agentSelectorType"), - "maxMachines": obj.get("maxMachines") + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25 }) return _obj diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_http_server_base_test.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_http_server_base_test.py index ac58b6baa..46fd6aa39 100644 --- a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_http_server_base_test.py +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_http_server_base_test.py @@ -31,14 +31,14 @@ class EndpointHttpServerBaseTest(BaseModel): """ # noqa: E501 auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") - http_time_limit: Optional[StrictInt] = Field(default=None, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") + http_time_limit: Optional[StrictInt] = Field(default=5000, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") protocol: Optional[EndpointTestProtocol] = None - url: Optional[StrictStr] = Field(default=None, description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") - verify_certificate: Optional[StrictBool] = Field(default=None, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") - __properties: ClassVar[List[str]] = ["authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "url", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate"] + verify_certificate: Optional[StrictBool] = Field(default=True, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + url: Optional[StrictStr] = Field(default=None, description="The test target URL.") + __properties: ClassVar[List[str]] = ["authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate", "url"] model_config = ConfigDict( populate_by_name=True, @@ -94,13 +94,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "authType": obj.get("authType"), "hasPathTraceInSession": obj.get("hasPathTraceInSession"), - "httpTimeLimit": obj.get("httpTimeLimit"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5000, "protocol": obj.get("protocol"), - "url": obj.get("url"), "username": obj.get("username"), "sslVersionId": obj.get("sslVersionId"), "tcpProbeMode": obj.get("tcpProbeMode"), - "verifyCertificate": obj.get("verifyCertificate") + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else True, + "url": obj.get("url") }) return _obj diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_http_server_instant_test.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_http_server_instant_test.py index 543ec2f35..96202a1db 100644 --- a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_http_server_instant_test.py +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_http_server_instant_test.py @@ -31,26 +31,27 @@ class EndpointHttpServerInstantTest(BaseModel): """ EndpointHttpServerInstantTest """ # noqa: E501 - agent_selector_type: EndpointTestAgentSelectorType = Field(alias="agentSelectorType") + agent_selector_type: Optional[EndpointTestAgentSelectorType] = Field(default=None, alias="agentSelectorType") agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") - has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") - has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") - max_machines: Annotated[int, Field(le=50000, strict=True, ge=1)] = Field(description="Maximum number of agents which can execute the test.", alias="maxMachines") - port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") test_name: StrictStr = Field(description="Name of the test.", alias="testName") auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") - http_time_limit: StrictInt = Field(description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") + http_time_limit: Optional[StrictInt] = Field(default=5000, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") protocol: Optional[EndpointTestProtocol] = None - url: StrictStr = Field(description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") - ssl_version_id: TestSslVersionId = Field(alias="sslVersionId") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") - verify_certificate: StrictBool = Field(description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") - target_response_time: StrictInt = Field(description="Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red).", alias="targetResponseTime") + verify_certificate: Optional[StrictBool] = Field(default=True, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + url: StrictStr = Field(description="The test target URL. You can optionally specify the protocol (`http` or `https`). - **Default Protocol:** If no protocol is specified, `https` is used by default. - **Port Number:** To specify a port, append it to the URL with a colon after the hostname or IP address (e.g., `https://example.com:443`). - If no port is specified in the URL, the `port` is determined by either the deprecated `port` field or the default protocol (HTTP: 80, HTTPS: 443). ") + has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") + has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + target_response_time: Optional[StrictInt] = Field(default=1000, description="Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red).", alias="targetResponseTime") password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") - __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "hasPing", "hasTraceroute", "endpointAgentLabels", "maxMachines", "port", "testName", "authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "url", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate", "targetResponseTime", "password"] + port: Optional[StrictInt] = Field(default=None, description="**(Deprecated)** The port number to use for the test. It's recommended to specify the port directly in the `url` field instead. If this field is set, it will override the default protocol ports (HTTP: 80, HTTPS: 443) and any port specified in the `url`. ") + __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "endpointAgentLabels", "maxMachines", "testName", "authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate", "url", "hasPing", "hasTraceroute", "networkMeasurements", "targetResponseTime", "password", "port"] model_config = ConfigDict( populate_by_name=True, @@ -106,23 +107,24 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "agentSelectorType": obj.get("agentSelectorType"), "agents": obj.get("agents"), - "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, - "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, "endpointAgentLabels": obj.get("endpointAgentLabels"), - "maxMachines": obj.get("maxMachines"), - "port": obj.get("port"), + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25, "testName": obj.get("testName"), "authType": obj.get("authType"), "hasPathTraceInSession": obj.get("hasPathTraceInSession"), - "httpTimeLimit": obj.get("httpTimeLimit"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5000, "protocol": obj.get("protocol"), - "url": obj.get("url"), "username": obj.get("username"), "sslVersionId": obj.get("sslVersionId"), "tcpProbeMode": obj.get("tcpProbeMode"), - "verifyCertificate": obj.get("verifyCertificate"), - "targetResponseTime": obj.get("targetResponseTime"), - "password": obj.get("password") + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else True, + "url": obj.get("url"), + "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, + "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "targetResponseTime": obj.get("targetResponseTime") if obj.get("targetResponseTime") is not None else 1000, + "password": obj.get("password"), + "port": obj.get("port") }) return _obj diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_http_server_test.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_http_server_test.py index e3fc94a8c..67a018258 100644 --- a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_http_server_test.py +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_http_server_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.endpoint_tests.models.alert_rule import AlertRule from thousandeyes_sdk.endpoint_tests.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig from thousandeyes_sdk.endpoint_tests.models.endpoint_test_auth_type import EndpointTestAuthType from thousandeyes_sdk.endpoint_tests.models.endpoint_test_links import EndpointTestLinks @@ -46,30 +45,26 @@ class EndpointHttpServerTest(BaseModel): has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") - port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") protocol: Optional[EndpointTestProtocol] = None server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") type: Annotated[str, Field(strict=True)] = Field(description="Type of test being queried.") tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") - alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + port: Optional[StrictInt] = Field(default=443, description="Port number.") auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") - http_time_limit: Optional[StrictInt] = Field(default=None, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") - url: Optional[StrictStr] = Field(default=None, description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") + http_time_limit: Optional[StrictInt] = Field(default=5000, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") - verify_certificate: Optional[StrictBool] = Field(default=None, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") - content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + verify_certificate: Optional[StrictBool] = Field(default=True, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + url: Optional[StrictStr] = Field(default=None, description="The test target URL.") follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") - post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") - user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") labels: Optional[List[TestLabel]] = None - __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "alertRules", "authType", "httpTimeLimit", "url", "username", "sslVersionId", "verifyCertificate", "contentRegex", "followRedirects", "httpTargetTime", "httpVersion", "postBody", "sslVersion", "useNtlm", "userAgent", "labels"] + __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "port", "authType", "httpTimeLimit", "username", "sslVersionId", "verifyCertificate", "url", "followRedirects", "httpTargetTime", "httpVersion", "sslVersion", "useNtlm", "labels"] @field_validator('type') def type_validate_regular_expression(cls, value): @@ -138,13 +133,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of agent_selector_config if self.agent_selector_config: _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) - _items = [] - if self.alert_rules: - for _item in self.alert_rules: - if _item: - _items.append(_item.to_dict()) - _dict['alertRules'] = _items # override the default output from pydantic by calling `to_dict()` of each item in labels (list) _items = [] if self.labels: @@ -174,28 +162,24 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "hasPathTraceInSession": obj.get("hasPathTraceInSession"), "modifiedDate": obj.get("modifiedDate"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, - "port": obj.get("port"), "protocol": obj.get("protocol"), "server": obj.get("server"), "testId": obj.get("testId"), "testName": obj.get("testName"), "type": obj.get("type"), "tcpProbeMode": obj.get("tcpProbeMode"), - "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "port": obj.get("port") if obj.get("port") is not None else 443, "authType": obj.get("authType"), - "httpTimeLimit": obj.get("httpTimeLimit"), - "url": obj.get("url"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5000, "username": obj.get("username"), "sslVersionId": obj.get("sslVersionId"), - "verifyCertificate": obj.get("verifyCertificate"), - "contentRegex": obj.get("contentRegex"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else True, + "url": obj.get("url"), "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, "httpTargetTime": obj.get("httpTargetTime"), "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, - "postBody": obj.get("postBody"), "sslVersion": obj.get("sslVersion"), "useNtlm": obj.get("useNtlm"), - "userAgent": obj.get("userAgent"), "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None }) return _obj diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_http_server_test_request.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_http_server_test_request.py index d29bf3981..0931e840a 100644 --- a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_http_server_test_request.py +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_http_server_test_request.py @@ -32,27 +32,28 @@ class EndpointHttpServerTestRequest(BaseModel): """ EndpointHttpServerTestRequest """ # noqa: E501 - agent_selector_type: EndpointTestAgentSelectorType = Field(alias="agentSelectorType") + agent_selector_type: Optional[EndpointTestAgentSelectorType] = Field(default=None, alias="agentSelectorType") agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") - has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") - has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") - max_machines: Annotated[int, Field(le=50000, strict=True, ge=1)] = Field(description="Maximum number of agents which can execute the test.", alias="maxMachines") - port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") test_name: StrictStr = Field(description="Name of the test.", alias="testName") auth_type: Optional[EndpointTestAuthType] = Field(default=None, alias="authType") has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") - http_time_limit: StrictInt = Field(description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") + http_time_limit: Optional[StrictInt] = Field(default=5000, description="Maximum amount of time in milliseconds the agents wait before a request times out.", alias="httpTimeLimit") protocol: Optional[EndpointTestProtocol] = None - url: StrictStr = Field(description="Test target URL. Optionally, you can specify a protocol (http or https). If no protocol is provided, the default `https` protocol is used.") username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") - ssl_version_id: TestSslVersionId = Field(alias="sslVersionId") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") - verify_certificate: StrictBool = Field(description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") - target_response_time: StrictInt = Field(description="Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red).", alias="targetResponseTime") + verify_certificate: Optional[StrictBool] = Field(default=True, description="Flag indicating if a certificate should be verified.", alias="verifyCertificate") + url: StrictStr = Field(description="The test target URL. You can optionally specify the protocol (`http` or `https`). - **Default Protocol:** If no protocol is specified, `https` is used by default. - **Port Number:** To specify a port, append it to the URL with a colon after the hostname or IP address (e.g., `https://example.com:443`). - If no port is specified in the URL, the `port` is determined by either the deprecated `port` field or the default protocol (HTTP: 80, HTTPS: 443). ") + has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") + has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + target_response_time: Optional[StrictInt] = Field(default=1000, description="Response time target in milliseconds. Affects the colors of agents and legends on the view page. The value is compared with actual response time in order to determine the color scale (from green to red).", alias="targetResponseTime") password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") - interval: TestInterval - __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "hasPing", "hasTraceroute", "endpointAgentLabels", "maxMachines", "port", "testName", "authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "url", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate", "targetResponseTime", "password", "interval"] + port: Optional[StrictInt] = Field(default=None, description="**(Deprecated)** The port number to use for the test. It's recommended to specify the port directly in the `url` field instead. If this field is set, it will override the default protocol ports (HTTP: 80, HTTPS: 443) and any port specified in the `url`. ") + interval: Optional[TestInterval] = None + __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "endpointAgentLabels", "maxMachines", "testName", "authType", "hasPathTraceInSession", "httpTimeLimit", "protocol", "username", "sslVersionId", "tcpProbeMode", "verifyCertificate", "url", "hasPing", "hasTraceroute", "networkMeasurements", "targetResponseTime", "password", "port", "interval"] model_config = ConfigDict( populate_by_name=True, @@ -108,23 +109,24 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "agentSelectorType": obj.get("agentSelectorType"), "agents": obj.get("agents"), - "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, - "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, "endpointAgentLabels": obj.get("endpointAgentLabels"), - "maxMachines": obj.get("maxMachines"), - "port": obj.get("port"), + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25, "testName": obj.get("testName"), "authType": obj.get("authType"), "hasPathTraceInSession": obj.get("hasPathTraceInSession"), - "httpTimeLimit": obj.get("httpTimeLimit"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5000, "protocol": obj.get("protocol"), - "url": obj.get("url"), "username": obj.get("username"), "sslVersionId": obj.get("sslVersionId"), "tcpProbeMode": obj.get("tcpProbeMode"), - "verifyCertificate": obj.get("verifyCertificate"), - "targetResponseTime": obj.get("targetResponseTime"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else True, + "url": obj.get("url"), + "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, + "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "targetResponseTime": obj.get("targetResponseTime") if obj.get("targetResponseTime") is not None else 1000, "password": obj.get("password"), + "port": obj.get("port"), "interval": obj.get("interval") }) return _obj diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_instant_test.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_instant_test.py index 5b649d652..e424ae6df 100644 --- a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_instant_test.py +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_instant_test.py @@ -16,7 +16,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from thousandeyes_sdk.endpoint_tests.models.endpoint_test_agent_selector_type import EndpointTestAgentSelectorType @@ -27,15 +27,12 @@ class EndpointInstantTest(BaseModel): """ EndpointInstantTest """ # noqa: E501 - agent_selector_type: EndpointTestAgentSelectorType = Field(alias="agentSelectorType") + agent_selector_type: Optional[EndpointTestAgentSelectorType] = Field(default=None, alias="agentSelectorType") agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") - has_ping: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run ping.", alias="hasPing") - has_traceroute: Optional[StrictBool] = Field(default=True, description="Optional flag indicating if the test should run traceroute.", alias="hasTraceroute") endpoint_agent_labels: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent label IDs (obtained from `/endpoint/labels` endpoint), required when `agentSelectorType` is set to `agent-labels`.", alias="endpointAgentLabels") - max_machines: Annotated[int, Field(le=50000, strict=True, ge=1)] = Field(description="Maximum number of agents which can execute the test.", alias="maxMachines") - port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") test_name: StrictStr = Field(description="Name of the test.", alias="testName") - __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "hasPing", "hasTraceroute", "endpointAgentLabels", "maxMachines", "port", "testName"] + __properties: ClassVar[List[str]] = ["agentSelectorType", "agents", "endpointAgentLabels", "maxMachines", "testName"] model_config = ConfigDict( populate_by_name=True, @@ -91,11 +88,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "agentSelectorType": obj.get("agentSelectorType"), "agents": obj.get("agents"), - "hasPing": obj.get("hasPing") if obj.get("hasPing") is not None else True, - "hasTraceroute": obj.get("hasTraceroute") if obj.get("hasTraceroute") is not None else True, "endpointAgentLabels": obj.get("endpointAgentLabels"), - "maxMachines": obj.get("maxMachines"), - "port": obj.get("port"), + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25, "testName": obj.get("testName") }) return _obj diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_specific_agents_selector_config.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_specific_agents_selector_config.py index 40b8fed56..de348366c 100644 --- a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_specific_agents_selector_config.py +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_specific_agents_selector_config.py @@ -27,7 +27,7 @@ class EndpointSpecificAgentsSelectorConfig(BaseModel): Specific agents selection object. """ # noqa: E501 agent_selector_type: Annotated[str, Field(strict=True)] = Field(alias="agentSelectorType") - max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=None, description="Maximum number of agents which can execute the test.", alias="maxMachines") + max_machines: Optional[Annotated[int, Field(le=50000, strict=True, ge=1)]] = Field(default=25, description="Maximum number of agents which can execute the test.", alias="maxMachines") agents: Optional[List[StrictStr]] = Field(default=None, description="List of endpoint agent IDs (obtained from `/endpoint/agents` endpoint). Required when `agentSelectorType` is set to `specific-agent`.") __properties: ClassVar[List[str]] = ["agentSelectorType", "maxMachines", "agents"] @@ -91,7 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "agentSelectorType": obj.get("agentSelectorType"), - "maxMachines": obj.get("maxMachines"), + "maxMachines": obj.get("maxMachines") if obj.get("maxMachines") is not None else 25, "agents": obj.get("agents") }) return _obj diff --git a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_test.py b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_test.py index 8722bf17b..a4163ffe6 100644 --- a/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_test.py +++ b/thousandeyes-sdk-endpoint-tests/src/thousandeyes_sdk/endpoint_tests/models/endpoint_test.py @@ -19,7 +19,6 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.endpoint_tests.models.alert_rule import AlertRule from thousandeyes_sdk.endpoint_tests.models.endpoint_agent_selector_config import EndpointAgentSelectorConfig from thousandeyes_sdk.endpoint_tests.models.endpoint_scheduled_test_type import EndpointScheduledTestType from thousandeyes_sdk.endpoint_tests.models.endpoint_test_links import EndpointTestLinks @@ -43,15 +42,14 @@ class EndpointTest(BaseModel): has_path_trace_in_session: Optional[StrictBool] = Field(default=None, description="Enables \"in session\" path trace. When enabled, this option initiates a TCP session with the target server and sends path trace packets within the established TCP session.", alias="hasPathTraceInSession") modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") - port: Optional[StrictInt] = Field(default=None, description="Port number, if not specified, the port is selected based on a protocol (HTTP 80, HTTPS 443).") protocol: Optional[EndpointTestProtocol] = None server: Optional[StrictStr] = Field(default=None, description="Target domain name or IP address.") test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned a unique ID to access test data from other endpoints.", alias="testId") test_name: Optional[StrictStr] = Field(default=None, description="Name of the test.", alias="testName") type: EndpointScheduledTestType tcp_probe_mode: Optional[TestProbeModeResponse] = Field(default=None, alias="tcpProbeMode") - alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") - __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "port", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "alertRules"] + port: Optional[StrictInt] = Field(default=443, description="Port number.") + __properties: ClassVar[List[str]] = ["aid", "_links", "agentSelectorConfig", "createdDate", "interval", "isEnabled", "isSavedEvent", "hasPathTraceInSession", "modifiedDate", "networkMeasurements", "protocol", "server", "testId", "testName", "type", "tcpProbeMode", "port"] model_config = ConfigDict( populate_by_name=True, @@ -107,13 +105,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of agent_selector_config if self.agent_selector_config: _dict['agentSelectorConfig'] = self.agent_selector_config.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) - _items = [] - if self.alert_rules: - for _item in self.alert_rules: - if _item: - _items.append(_item.to_dict()) - _dict['alertRules'] = _items return _dict @classmethod @@ -136,14 +127,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "hasPathTraceInSession": obj.get("hasPathTraceInSession"), "modifiedDate": obj.get("modifiedDate"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, - "port": obj.get("port"), "protocol": obj.get("protocol"), "server": obj.get("server"), "testId": obj.get("testId"), "testName": obj.get("testName"), "type": obj.get("type"), "tcpProbeMode": obj.get("tcpProbeMode"), - "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None + "port": obj.get("port") if obj.get("port") is not None else 443 }) return _obj diff --git a/thousandeyes-sdk-endpoint-tests/test/test_agent_to_server_endpoint_dynamic_tests_api.py b/thousandeyes-sdk-endpoint-tests/test/test_agent_to_server_endpoint_dynamic_tests_api.py new file mode 100644 index 000000000..5d8811596 --- /dev/null +++ b/thousandeyes-sdk-endpoint-tests/test/test_agent_to_server_endpoint_dynamic_tests_api.py @@ -0,0 +1,346 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.endpoint_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.endpoint_tests.api.agent_to_server_endpoint_dynamic_tests_api import AgentToServerEndpointDynamicTestsApi + + +class TestAgentToServerEndpointDynamicTestsApi(unittest.TestCase): + """AgentToServerEndpointDynamicTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = AgentToServerEndpointDynamicTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_agent_to_server_endpoint_dynamic_test_models_validation(self) -> None: + """Test case for create_agent_to_server_endpoint_dynamic_test request and response models""" + request_body_json = """ + { + "protocol" : "icmp", + "application" : "webex", + "agentSelectorType" : "all-agents", + "maxMachines" : 25, + "interval" : 60, + "hasPathTraceInSession" : true, + "endpointAgentLabels" : [ "567", "214" ], + "tcpProbeMode" : "auto", + "agents" : [ "0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1", "66eec0f1-72b4-4755-aa83-3aed61d17f3c" ], + "testName" : "Test name" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_tests.models.DynamicTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "hasPing" : true, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "tcpProbeMode" : "auto", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "application" : "webex", + "hasTraceroute" : true, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_tests.models.DynamicTest.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_agent_to_server_endpoint_dynamic_test_models_validation(self) -> None: + """Test case for delete_agent_to_server_endpoint_dynamic_test request and response models""" + + + def test_get_agent_to_server_endpoint_dynamic_test_models_validation(self) -> None: + """Test case for get_agent_to_server_endpoint_dynamic_test request and response models""" + + response_body_json = """ + { + "hasPing" : true, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "tcpProbeMode" : "auto", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "application" : "webex", + "hasTraceroute" : true, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_tests.models.DynamicTest.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_agent_to_server_endpoint_dynamic_tests_models_validation(self) -> None: + """Test case for get_agent_to_server_endpoint_dynamic_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "hasPing" : true, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "tcpProbeMode" : "auto", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "application" : "webex", + "hasTraceroute" : true, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + }, { + "hasPing" : true, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "tcpProbeMode" : "auto", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "application" : "webex", + "hasTraceroute" : true, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_tests.models.DynamicTests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_agent_to_server_endpoint_dynamic_test_models_validation(self) -> None: + """Test case for update_agent_to_server_endpoint_dynamic_test request and response models""" + request_body_json = """ + { + "protocol" : "icmp", + "application" : "webex", + "isEnabled" : true, + "interval" : 60, + "tcpProbeMode" : "auto", + "testName" : "Test name" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_tests.models.EndpointDynamicTestUpdate.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "hasPing" : true, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/dynamic-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "tcpProbeMode" : "auto", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "application" : "webex", + "hasTraceroute" : true, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_tests.models.DynamicTest.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-endpoint-tests/test/test_agent_to_server_endpoint_scheduled_tests_api.py b/thousandeyes-sdk-endpoint-tests/test/test_agent_to_server_endpoint_scheduled_tests_api.py new file mode 100644 index 000000000..39d5cf329 --- /dev/null +++ b/thousandeyes-sdk-endpoint-tests/test/test_agent_to_server_endpoint_scheduled_tests_api.py @@ -0,0 +1,351 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.endpoint_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.endpoint_tests.api.agent_to_server_endpoint_scheduled_tests_api import AgentToServerEndpointScheduledTestsApi + + +class TestAgentToServerEndpointScheduledTestsApi(unittest.TestCase): + """AgentToServerEndpointScheduledTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = AgentToServerEndpointScheduledTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_agent_to_server_endpoint_scheduled_test_models_validation(self) -> None: + """Test case for create_agent_to_server_endpoint_scheduled_test request and response models""" + request_body_json = """ + { + "protocol" : "icmp", + "port" : 443, + "agentSelectorType" : "all-agents", + "maxMachines" : 25, + "serverName" : "www.example.com", + "interval" : 60, + "endpointAgentLabels" : [ "567", "214" ], + "agents" : [ "0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1", "66eec0f1-72b4-4755-aa83-3aed61d17f3c" ], + "testName" : "Test name" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_tests.models.EndpointAgentToServerTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "server" : "www.example.com", + "isSavedEvent" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "type" : "agent-to-server", + "tcpProbeMode" : "auto", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_tests.models.EndpointAgentToServerTest.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_agent_to_server_endpoint_scheduled_test_models_validation(self) -> None: + """Test case for delete_agent_to_server_endpoint_scheduled_test request and response models""" + + + def test_get_agent_to_server_endpoint_scheduled_test_models_validation(self) -> None: + """Test case for get_agent_to_server_endpoint_scheduled_test request and response models""" + + response_body_json = """ + { + "server" : "www.example.com", + "isSavedEvent" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "type" : "agent-to-server", + "tcpProbeMode" : "auto", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_tests.models.EndpointAgentToServerTest.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_agent_to_server_endpoint_scheduled_tests_models_validation(self) -> None: + """Test case for get_agent_to_server_endpoint_scheduled_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "server" : "www.example.com", + "isSavedEvent" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "type" : "agent-to-server", + "tcpProbeMode" : "auto", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + }, { + "server" : "www.example.com", + "isSavedEvent" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "type" : "agent-to-server", + "tcpProbeMode" : "auto", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_tests.models.EndpointAgentToServerTests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_agent_to_server_endpoint_scheduled_test_models_validation(self) -> None: + """Test case for update_agent_to_server_endpoint_scheduled_test request and response models""" + request_body_json = """ + { + "server" : "www.example.com", + "protocol" : "icmp", + "port" : 49153, + "isEnabled" : true, + "interval" : 60, + "tcpProbeMode" : "auto", + "testName" : "Test name" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_tests.models.EndpointNetworkTestUpdate.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "server" : "www.example.com", + "isSavedEvent" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "type" : "agent-to-server", + "tcpProbeMode" : "auto", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_tests.models.EndpointAgentToServerTest.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-endpoint-tests/test/test_endpoint_scheduled_tests_api.py b/thousandeyes-sdk-endpoint-tests/test/test_endpoint_scheduled_tests_api.py new file mode 100644 index 000000000..806036764 --- /dev/null +++ b/thousandeyes-sdk-endpoint-tests/test/test_endpoint_scheduled_tests_api.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.endpoint_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.endpoint_tests.api.endpoint_scheduled_tests_api import EndpointScheduledTestsApi + + +class TestEndpointScheduledTestsApi(unittest.TestCase): + """EndpointScheduledTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = EndpointScheduledTestsApi() + + def tearDown(self) -> None: + pass + + def test_get_endpoint_scheduled_tests_models_validation(self) -> None: + """Test case for get_endpoint_scheduled_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "server" : "www.example.com", + "isSavedEvent" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "type" : "agent-to-server", + "tcpProbeMode" : "auto", + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + }, { + "server" : "www.example.com", + "isSavedEvent" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkMeasurements" : true, + "type" : "agent-to-server", + "tcpProbeMode" : "auto", + "protocol" : "icmp", + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "testName" : "Test name" + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_tests.models.EndpointTests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-endpoint-tests/test/test_http_server_endpoint_scheduled_tests_api.py b/thousandeyes-sdk-endpoint-tests/test/test_http_server_endpoint_scheduled_tests_api.py new file mode 100644 index 000000000..612bb3a22 --- /dev/null +++ b/thousandeyes-sdk-endpoint-tests/test/test_http_server_endpoint_scheduled_tests_api.py @@ -0,0 +1,417 @@ +# coding: utf-8 + +""" + Endpoint Tests API + + Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.endpoint_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.endpoint_tests.api.http_server_endpoint_scheduled_tests_api import HTTPServerEndpointScheduledTestsApi + + +class TestHTTPServerEndpointScheduledTestsApi(unittest.TestCase): + """HTTPServerEndpointScheduledTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = HTTPServerEndpointScheduledTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_http_server_endpoint_scheduled_test_models_validation(self) -> None: + """Test case for create_http_server_endpoint_scheduled_test request and response models""" + request_body_json = """ + { + "verifyCertificate" : true, + "hasPing" : true, + "agentSelectorType" : "all-agents", + "maxMachines" : 25, + "httpTimeLimit" : 5000, + "networkMeasurements" : true, + "endpointAgentLabels" : [ "567", "214" ], + "tcpProbeMode" : "auto", + "url" : "url", + "agents" : [ "0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1", "66eec0f1-72b4-4755-aa83-3aed61d17f3c" ], + "protocol" : "icmp", + "password" : "password", + "port" : 443, + "hasTraceroute" : true, + "targetResponseTime" : 1000, + "interval" : 60, + "authType" : "none", + "hasPathTraceInSession" : true, + "testName" : "Test name", + "username" : "username", + "sslVersionId" : "0" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_tests.models.EndpointHttpServerTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "server" : "www.example.com", + "isSavedEvent" : false, + "sslVersion" : "Auto", + "useNtlm" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "httpTimeLimit" : 5000, + "type" : "http-server", + "protocol" : "icmp", + "httpVersion" : 2, + "followRedirects" : true, + "authType" : "none", + "testName" : "Test name", + "verifyCertificate" : true, + "networkMeasurements" : true, + "tcpProbeMode" : "auto", + "url" : "https://example.com:443", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "httpTargetTime" : 100, + "username" : "username", + "sslVersionId" : "0" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_tests.models.EndpointHttpServerTest.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_http_server_endpoint_scheduled_test_models_validation(self) -> None: + """Test case for delete_http_server_endpoint_scheduled_test request and response models""" + + + def test_get_http_server_endpoint_scheduled_test_models_validation(self) -> None: + """Test case for get_http_server_endpoint_scheduled_test request and response models""" + + response_body_json = """ + { + "server" : "www.example.com", + "isSavedEvent" : false, + "sslVersion" : "Auto", + "useNtlm" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "httpTimeLimit" : 5000, + "type" : "http-server", + "protocol" : "icmp", + "httpVersion" : 2, + "followRedirects" : true, + "authType" : "none", + "testName" : "Test name", + "verifyCertificate" : true, + "networkMeasurements" : true, + "tcpProbeMode" : "auto", + "url" : "https://example.com:443", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "httpTargetTime" : 100, + "username" : "username", + "sslVersionId" : "0" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_tests.models.EndpointHttpServerTest.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_http_server_endpoint_scheduled_tests_models_validation(self) -> None: + """Test case for get_http_server_endpoint_scheduled_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "server" : "www.example.com", + "isSavedEvent" : false, + "sslVersion" : "Auto", + "useNtlm" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "httpTimeLimit" : 5000, + "type" : "http-server", + "protocol" : "icmp", + "httpVersion" : 2, + "followRedirects" : true, + "authType" : "none", + "testName" : "Test name", + "verifyCertificate" : true, + "networkMeasurements" : true, + "tcpProbeMode" : "auto", + "url" : "https://example.com:443", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "httpTargetTime" : 100, + "username" : "username", + "sslVersionId" : "0" + }, { + "server" : "www.example.com", + "isSavedEvent" : false, + "sslVersion" : "Auto", + "useNtlm" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "httpTimeLimit" : 5000, + "type" : "http-server", + "protocol" : "icmp", + "httpVersion" : 2, + "followRedirects" : true, + "authType" : "none", + "testName" : "Test name", + "verifyCertificate" : true, + "networkMeasurements" : true, + "tcpProbeMode" : "auto", + "url" : "https://example.com:443", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "httpTargetTime" : 100, + "username" : "username", + "sslVersionId" : "0" + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_tests.models.EndpointHttpServerTests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_http_server_endpoint_scheduled_test_models_validation(self) -> None: + """Test case for update_http_server_endpoint_scheduled_test request and response models""" + request_body_json = """ + { + "protocol" : "icmp", + "isEnabled" : true, + "interval" : 60, + "tcpProbeMode" : "auto", + "url" : "www.thousandeyes.com", + "testName" : "Test name" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.endpoint_tests.models.EndpointHttpTestUpdate.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "server" : "www.example.com", + "isSavedEvent" : false, + "sslVersion" : "Auto", + "useNtlm" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter" + }, { + "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "httpTimeLimit" : 5000, + "type" : "http-server", + "protocol" : "icmp", + "httpVersion" : 2, + "followRedirects" : true, + "authType" : "none", + "testName" : "Test name", + "verifyCertificate" : true, + "networkMeasurements" : true, + "tcpProbeMode" : "auto", + "url" : "https://example.com:443", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "port" : 443, + "isEnabled" : true, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "aid" : "1234", + "agentSelectorConfig" : { + "agentSelectorType" : "all-agents", + "maxMachines" : 25 + }, + "hasPathTraceInSession" : true, + "httpTargetTime" : 100, + "username" : "username", + "sslVersionId" : "0" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.endpoint_tests.models.EndpointHttpServerTest.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-event-detection/.openapi-generator/FILES b/thousandeyes-sdk-event-detection/.openapi-generator/FILES index 3c90a840a..36db1126f 100644 --- a/thousandeyes-sdk-event-detection/.openapi-generator/FILES +++ b/thousandeyes-sdk-event-detection/.openapi-generator/FILES @@ -8,17 +8,19 @@ docs/AffectedTests.md docs/AgentLinks.md docs/AgentLocalEventDetail.md docs/AgentLocalEventGrouping.md -docs/ApiAffectedAgent.md docs/ApiAffectedTarget.md -docs/ApiAffectedTest.md docs/CloudEnterpriseAgentType.md docs/DnsEventDetail.md docs/DnsEventGrouping.md docs/Error.md docs/Event.md +docs/EventAlertSeverity.md +docs/EventApiAffectedAgent.md +docs/EventApiAffectedTest.md docs/EventDetail.md docs/EventDetailBase.md docs/EventState.md +docs/EventTestLinks.md docs/EventType.md docs/Events.md docs/EventsApi.md @@ -30,13 +32,11 @@ docs/PaginationNextAndSelfLinks.md docs/ProxyEventDetail.md docs/ProxyEventGrouping.md docs/SelfLinks.md -docs/Severity.md docs/SimpleEventDetail.md docs/TargetEventDetail.md docs/TargetEventGrouping.md docs/TargetNetworkEventDetail.md docs/TargetNetworkEventGrouping.md -docs/TestLinks.md docs/TestType.md docs/UnauthorizedError.md docs/ValidationError.md @@ -54,17 +54,19 @@ src/thousandeyes_sdk/event_detection/models/affected_tests.py src/thousandeyes_sdk/event_detection/models/agent_links.py src/thousandeyes_sdk/event_detection/models/agent_local_event_detail.py src/thousandeyes_sdk/event_detection/models/agent_local_event_grouping.py -src/thousandeyes_sdk/event_detection/models/api_affected_agent.py src/thousandeyes_sdk/event_detection/models/api_affected_target.py -src/thousandeyes_sdk/event_detection/models/api_affected_test.py src/thousandeyes_sdk/event_detection/models/cloud_enterprise_agent_type.py src/thousandeyes_sdk/event_detection/models/dns_event_detail.py src/thousandeyes_sdk/event_detection/models/dns_event_grouping.py src/thousandeyes_sdk/event_detection/models/error.py src/thousandeyes_sdk/event_detection/models/event.py +src/thousandeyes_sdk/event_detection/models/event_alert_severity.py +src/thousandeyes_sdk/event_detection/models/event_api_affected_agent.py +src/thousandeyes_sdk/event_detection/models/event_api_affected_test.py src/thousandeyes_sdk/event_detection/models/event_detail.py src/thousandeyes_sdk/event_detection/models/event_detail_base.py src/thousandeyes_sdk/event_detection/models/event_state.py +src/thousandeyes_sdk/event_detection/models/event_test_links.py src/thousandeyes_sdk/event_detection/models/event_type.py src/thousandeyes_sdk/event_detection/models/events.py src/thousandeyes_sdk/event_detection/models/link.py @@ -75,13 +77,11 @@ src/thousandeyes_sdk/event_detection/models/pagination_next_and_self_links.py src/thousandeyes_sdk/event_detection/models/proxy_event_detail.py src/thousandeyes_sdk/event_detection/models/proxy_event_grouping.py src/thousandeyes_sdk/event_detection/models/self_links.py -src/thousandeyes_sdk/event_detection/models/severity.py src/thousandeyes_sdk/event_detection/models/simple_event_detail.py src/thousandeyes_sdk/event_detection/models/target_event_detail.py src/thousandeyes_sdk/event_detection/models/target_event_grouping.py src/thousandeyes_sdk/event_detection/models/target_network_event_detail.py src/thousandeyes_sdk/event_detection/models/target_network_event_grouping.py -src/thousandeyes_sdk/event_detection/models/test_links.py src/thousandeyes_sdk/event_detection/models/test_type.py src/thousandeyes_sdk/event_detection/models/unauthorized_error.py src/thousandeyes_sdk/event_detection/models/validation_error.py diff --git a/thousandeyes-sdk-event-detection/README.md b/thousandeyes-sdk-event-detection/README.md index 7025e5526..aeb49e91d 100644 --- a/thousandeyes-sdk-event-detection/README.md +++ b/thousandeyes-sdk-event-detection/README.md @@ -12,7 +12,7 @@ With the Events API, you can perform the following tasks on the ThousandEyes pla This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -117,17 +117,19 @@ Class | Method | HTTP request | Description - [AgentLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/AgentLinks.md) - [AgentLocalEventDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/AgentLocalEventDetail.md) - [AgentLocalEventGrouping](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/AgentLocalEventGrouping.md) - - [ApiAffectedAgent](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/ApiAffectedAgent.md) - [ApiAffectedTarget](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/ApiAffectedTarget.md) - - [ApiAffectedTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/ApiAffectedTest.md) - [CloudEnterpriseAgentType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/CloudEnterpriseAgentType.md) - [DnsEventDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/DnsEventDetail.md) - [DnsEventGrouping](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/DnsEventGrouping.md) - [Error](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/Error.md) - [Event](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/Event.md) + - [EventAlertSeverity](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/EventAlertSeverity.md) + - [EventApiAffectedAgent](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/EventApiAffectedAgent.md) + - [EventApiAffectedTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/EventApiAffectedTest.md) - [EventDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/EventDetail.md) - [EventDetailBase](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/EventDetailBase.md) - [EventState](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/EventState.md) + - [EventTestLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/EventTestLinks.md) - [EventType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/EventType.md) - [Events](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/Events.md) - [Link](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/Link.md) @@ -138,13 +140,11 @@ Class | Method | HTTP request | Description - [ProxyEventDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/ProxyEventDetail.md) - [ProxyEventGrouping](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/ProxyEventGrouping.md) - [SelfLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/SelfLinks.md) - - [Severity](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/Severity.md) - [SimpleEventDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/SimpleEventDetail.md) - [TargetEventDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/TargetEventDetail.md) - [TargetEventGrouping](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/TargetEventGrouping.md) - [TargetNetworkEventDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/TargetNetworkEventDetail.md) - [TargetNetworkEventGrouping](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/TargetNetworkEventGrouping.md) - - [TestLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/TestLinks.md) - [TestType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/TestType.md) - [UnauthorizedError](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/UnauthorizedError.md) - [ValidationError](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/ValidationError.md) diff --git a/thousandeyes-sdk-event-detection/docs/AffectedAgents.md b/thousandeyes-sdk-event-detection/docs/AffectedAgents.md index 2706b374d..34e259018 100644 --- a/thousandeyes-sdk-event-detection/docs/AffectedAgents.md +++ b/thousandeyes-sdk-event-detection/docs/AffectedAgents.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **total** | **int** | The total number affected. | [optional] [readonly] **in_account_group** | **int** | Indicates if in the affected account group. | [optional] [readonly] -**agents** | [**List[ApiAffectedAgent]**](ApiAffectedAgent.md) | List of affected agents. | [optional] +**agents** | [**List[EventApiAffectedAgent]**](EventApiAffectedAgent.md) | List of affected agents. | [optional] ## Example diff --git a/thousandeyes-sdk-event-detection/docs/AffectedTests.md b/thousandeyes-sdk-event-detection/docs/AffectedTests.md index dfd89725a..9a6de7649 100644 --- a/thousandeyes-sdk-event-detection/docs/AffectedTests.md +++ b/thousandeyes-sdk-event-detection/docs/AffectedTests.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **total** | **int** | The total number affected. | [optional] [readonly] **in_account_group** | **int** | Indicates if in the affected account group. | [optional] [readonly] -**tests** | [**List[ApiAffectedTest]**](ApiAffectedTest.md) | List of affected tests. | [optional] +**tests** | [**List[EventApiAffectedTest]**](EventApiAffectedTest.md) | List of affected tests. | [optional] ## Example diff --git a/thousandeyes-sdk-event-detection/docs/AgentLocalEventDetail.md b/thousandeyes-sdk-event-detection/docs/AgentLocalEventDetail.md index 98c1617c3..e216e2b9b 100644 --- a/thousandeyes-sdk-event-detection/docs/AgentLocalEventDetail.md +++ b/thousandeyes-sdk-event-detection/docs/AgentLocalEventDetail.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **state** | [**EventState**](EventState.md) | | [optional] **start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] **end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] -**severity** | [**Severity**](Severity.md) | | [optional] +**severity** | [**EventAlertSeverity**](EventAlertSeverity.md) | | [optional] **aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] **summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] **affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] diff --git a/thousandeyes-sdk-event-detection/docs/DnsEventDetail.md b/thousandeyes-sdk-event-detection/docs/DnsEventDetail.md index 5279864fd..6bd6eff10 100644 --- a/thousandeyes-sdk-event-detection/docs/DnsEventDetail.md +++ b/thousandeyes-sdk-event-detection/docs/DnsEventDetail.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **state** | [**EventState**](EventState.md) | | [optional] **start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] **end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] -**severity** | [**Severity**](Severity.md) | | [optional] +**severity** | [**EventAlertSeverity**](EventAlertSeverity.md) | | [optional] **aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] **summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] **affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] diff --git a/thousandeyes-sdk-event-detection/docs/Event.md b/thousandeyes-sdk-event-detection/docs/Event.md index 5706da1dc..01d6ae611 100644 --- a/thousandeyes-sdk-event-detection/docs/Event.md +++ b/thousandeyes-sdk-event-detection/docs/Event.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **state** | [**EventState**](EventState.md) | | [optional] **start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] **end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] -**severity** | [**Severity**](Severity.md) | | [optional] +**severity** | [**EventAlertSeverity**](EventAlertSeverity.md) | | [optional] **title** | **str** | Event title | [optional] [readonly] **type** | [**EventType**](EventType.md) | | [optional] **affected_tests** | [**AffectedCount**](AffectedCount.md) | | [optional] diff --git a/thousandeyes-sdk-event-detection/docs/EventAlertSeverity.md b/thousandeyes-sdk-event-detection/docs/EventAlertSeverity.md new file mode 100644 index 000000000..89fc89cc9 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/EventAlertSeverity.md @@ -0,0 +1,12 @@ +# EventAlertSeverity + +The severity of the alert. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/EventApiAffectedAgent.md b/thousandeyes-sdk-event-detection/docs/EventApiAffectedAgent.md new file mode 100644 index 000000000..8bcfbd3ae --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/EventApiAffectedAgent.md @@ -0,0 +1,36 @@ +# EventApiAffectedAgent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | The ID of the virtual agent. | [optional] [readonly] +**type** | [**CloudEnterpriseAgentType**](CloudEnterpriseAgentType.md) | | [optional] +**name** | **str** | The name of the agent as defined in settings. | [optional] [readonly] +**location** | **str** | The name of the agent's location. | [optional] [readonly] +**country_code** | **str** | The country code of the agent's location . | [optional] [readonly] +**affected_target_ids** | **List[str]** | An array of unique target IDs that contributed data points which generated the signal for the event. | [optional] +**affected_test_ids** | **List[str]** | An array of unique agent IDs that contributed data points which generated the signal for the event. | [optional] +**links** | [**AgentLinks**](AgentLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.event_api_affected_agent import EventApiAffectedAgent + +# TODO update the JSON string below +json = "{}" +# create an instance of EventApiAffectedAgent from a JSON string +event_api_affected_agent_instance = EventApiAffectedAgent.from_json(json) +# print the JSON string representation of the object +print(EventApiAffectedAgent.to_json()) + +# convert the object into a dict +event_api_affected_agent_dict = event_api_affected_agent_instance.to_dict() +# create an instance of EventApiAffectedAgent from a dict +event_api_affected_agent_from_dict = EventApiAffectedAgent.from_dict(event_api_affected_agent_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/EventApiAffectedTest.md b/thousandeyes-sdk-event-detection/docs/EventApiAffectedTest.md new file mode 100644 index 000000000..137ab0129 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/EventApiAffectedTest.md @@ -0,0 +1,34 @@ +# EventApiAffectedTest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**test_id** | **str** | The ID of the affected test. | [optional] [readonly] +**test_type** | [**TestType**](TestType.md) | | [optional] +**name** | **str** | The test name as configured in the test settings. | [optional] [readonly] +**affected_target_ids** | **List[str]** | An array of unique target IDs contributed data points which generated the signal for the event. | [optional] +**affected_agent_ids** | **List[str]** | An array of unique agent IDs that contributed data points which generated the signal for the event. | [optional] +**links** | [**EventTestLinks**](EventTestLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.event_api_affected_test import EventApiAffectedTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EventApiAffectedTest from a JSON string +event_api_affected_test_instance = EventApiAffectedTest.from_json(json) +# print the JSON string representation of the object +print(EventApiAffectedTest.to_json()) + +# convert the object into a dict +event_api_affected_test_dict = event_api_affected_test_instance.to_dict() +# create an instance of EventApiAffectedTest from a dict +event_api_affected_test_from_dict = EventApiAffectedTest.from_dict(event_api_affected_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/EventDetail.md b/thousandeyes-sdk-event-detection/docs/EventDetail.md index 7a694fb70..b3b4c39eb 100644 --- a/thousandeyes-sdk-event-detection/docs/EventDetail.md +++ b/thousandeyes-sdk-event-detection/docs/EventDetail.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **state** | [**EventState**](EventState.md) | | [optional] **start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] **end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] -**severity** | [**Severity**](Severity.md) | | [optional] +**severity** | [**EventAlertSeverity**](EventAlertSeverity.md) | | [optional] **aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] **summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] **affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] diff --git a/thousandeyes-sdk-event-detection/docs/EventDetailBase.md b/thousandeyes-sdk-event-detection/docs/EventDetailBase.md index bc884dbf7..305b1bd5b 100644 --- a/thousandeyes-sdk-event-detection/docs/EventDetailBase.md +++ b/thousandeyes-sdk-event-detection/docs/EventDetailBase.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **state** | [**EventState**](EventState.md) | | [optional] **start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] **end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] -**severity** | [**Severity**](Severity.md) | | [optional] +**severity** | [**EventAlertSeverity**](EventAlertSeverity.md) | | [optional] **aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] **summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] **affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] diff --git a/thousandeyes-sdk-event-detection/docs/EventTestLinks.md b/thousandeyes-sdk-event-detection/docs/EventTestLinks.md new file mode 100644 index 000000000..71f47b1f1 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/EventTestLinks.md @@ -0,0 +1,30 @@ +# EventTestLinks + +A links object containing the self link. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**test** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.event_test_links import EventTestLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of EventTestLinks from a JSON string +event_test_links_instance = EventTestLinks.from_json(json) +# print the JSON string representation of the object +print(EventTestLinks.to_json()) + +# convert the object into a dict +event_test_links_dict = event_test_links_instance.to_dict() +# create an instance of EventTestLinks from a dict +event_test_links_from_dict = EventTestLinks.from_dict(event_test_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/NetworkEventDetail.md b/thousandeyes-sdk-event-detection/docs/NetworkEventDetail.md index c55786d28..ff18ae965 100644 --- a/thousandeyes-sdk-event-detection/docs/NetworkEventDetail.md +++ b/thousandeyes-sdk-event-detection/docs/NetworkEventDetail.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **state** | [**EventState**](EventState.md) | | [optional] **start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] **end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] -**severity** | [**Severity**](Severity.md) | | [optional] +**severity** | [**EventAlertSeverity**](EventAlertSeverity.md) | | [optional] **aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] **summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] **affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] diff --git a/thousandeyes-sdk-event-detection/docs/NetworkPopEventDetail.md b/thousandeyes-sdk-event-detection/docs/NetworkPopEventDetail.md index 4ee74e868..b3685d60b 100644 --- a/thousandeyes-sdk-event-detection/docs/NetworkPopEventDetail.md +++ b/thousandeyes-sdk-event-detection/docs/NetworkPopEventDetail.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **state** | [**EventState**](EventState.md) | | [optional] **start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] **end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] -**severity** | [**Severity**](Severity.md) | | [optional] +**severity** | [**EventAlertSeverity**](EventAlertSeverity.md) | | [optional] **aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] **summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] **affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] diff --git a/thousandeyes-sdk-event-detection/docs/ProxyEventDetail.md b/thousandeyes-sdk-event-detection/docs/ProxyEventDetail.md index 79da16d32..292202cf9 100644 --- a/thousandeyes-sdk-event-detection/docs/ProxyEventDetail.md +++ b/thousandeyes-sdk-event-detection/docs/ProxyEventDetail.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **state** | [**EventState**](EventState.md) | | [optional] **start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] **end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] -**severity** | [**Severity**](Severity.md) | | [optional] +**severity** | [**EventAlertSeverity**](EventAlertSeverity.md) | | [optional] **aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] **summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] **affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] diff --git a/thousandeyes-sdk-event-detection/docs/SimpleEventDetail.md b/thousandeyes-sdk-event-detection/docs/SimpleEventDetail.md index a2c399075..dc24e4298 100644 --- a/thousandeyes-sdk-event-detection/docs/SimpleEventDetail.md +++ b/thousandeyes-sdk-event-detection/docs/SimpleEventDetail.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **state** | [**EventState**](EventState.md) | | [optional] **start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] **end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] -**severity** | [**Severity**](Severity.md) | | [optional] +**severity** | [**EventAlertSeverity**](EventAlertSeverity.md) | | [optional] ## Example diff --git a/thousandeyes-sdk-event-detection/docs/TargetEventDetail.md b/thousandeyes-sdk-event-detection/docs/TargetEventDetail.md index 984f9b8fd..c4f1956b8 100644 --- a/thousandeyes-sdk-event-detection/docs/TargetEventDetail.md +++ b/thousandeyes-sdk-event-detection/docs/TargetEventDetail.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **state** | [**EventState**](EventState.md) | | [optional] **start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] **end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] -**severity** | [**Severity**](Severity.md) | | [optional] +**severity** | [**EventAlertSeverity**](EventAlertSeverity.md) | | [optional] **aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] **summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] **affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] diff --git a/thousandeyes-sdk-event-detection/docs/TargetNetworkEventDetail.md b/thousandeyes-sdk-event-detection/docs/TargetNetworkEventDetail.md index 3d385ed98..059fd3f9c 100644 --- a/thousandeyes-sdk-event-detection/docs/TargetNetworkEventDetail.md +++ b/thousandeyes-sdk-event-detection/docs/TargetNetworkEventDetail.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **state** | [**EventState**](EventState.md) | | [optional] **start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] **end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] -**severity** | [**Severity**](Severity.md) | | [optional] +**severity** | [**EventAlertSeverity**](EventAlertSeverity.md) | | [optional] **aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] **summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] **affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/__init__.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/__init__.py index 5d821f9f3..2423650d7 100644 --- a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/__init__.py +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/__init__.py @@ -25,17 +25,19 @@ from thousandeyes_sdk.event_detection.models.agent_links import AgentLinks from thousandeyes_sdk.event_detection.models.agent_local_event_detail import AgentLocalEventDetail from thousandeyes_sdk.event_detection.models.agent_local_event_grouping import AgentLocalEventGrouping -from thousandeyes_sdk.event_detection.models.api_affected_agent import ApiAffectedAgent from thousandeyes_sdk.event_detection.models.api_affected_target import ApiAffectedTarget -from thousandeyes_sdk.event_detection.models.api_affected_test import ApiAffectedTest from thousandeyes_sdk.event_detection.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType from thousandeyes_sdk.event_detection.models.dns_event_detail import DnsEventDetail from thousandeyes_sdk.event_detection.models.dns_event_grouping import DnsEventGrouping from thousandeyes_sdk.event_detection.models.error import Error from thousandeyes_sdk.event_detection.models.event import Event +from thousandeyes_sdk.event_detection.models.event_alert_severity import EventAlertSeverity +from thousandeyes_sdk.event_detection.models.event_api_affected_agent import EventApiAffectedAgent +from thousandeyes_sdk.event_detection.models.event_api_affected_test import EventApiAffectedTest from thousandeyes_sdk.event_detection.models.event_detail import EventDetail from thousandeyes_sdk.event_detection.models.event_detail_base import EventDetailBase from thousandeyes_sdk.event_detection.models.event_state import EventState +from thousandeyes_sdk.event_detection.models.event_test_links import EventTestLinks from thousandeyes_sdk.event_detection.models.event_type import EventType from thousandeyes_sdk.event_detection.models.events import Events from thousandeyes_sdk.event_detection.models.link import Link @@ -46,13 +48,11 @@ from thousandeyes_sdk.event_detection.models.proxy_event_detail import ProxyEventDetail from thousandeyes_sdk.event_detection.models.proxy_event_grouping import ProxyEventGrouping from thousandeyes_sdk.event_detection.models.self_links import SelfLinks -from thousandeyes_sdk.event_detection.models.severity import Severity from thousandeyes_sdk.event_detection.models.simple_event_detail import SimpleEventDetail from thousandeyes_sdk.event_detection.models.target_event_detail import TargetEventDetail from thousandeyes_sdk.event_detection.models.target_event_grouping import TargetEventGrouping from thousandeyes_sdk.event_detection.models.target_network_event_detail import TargetNetworkEventDetail from thousandeyes_sdk.event_detection.models.target_network_event_grouping import TargetNetworkEventGrouping -from thousandeyes_sdk.event_detection.models.test_links import TestLinks from thousandeyes_sdk.event_detection.models.test_type import TestType from thousandeyes_sdk.event_detection.models.unauthorized_error import UnauthorizedError from thousandeyes_sdk.event_detection.models.validation_error import ValidationError diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/__init__.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/__init__.py index 80cab6b61..e5cb57b6e 100644 --- a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/__init__.py +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/__init__.py @@ -20,17 +20,19 @@ from thousandeyes_sdk.event_detection.models.agent_links import AgentLinks from thousandeyes_sdk.event_detection.models.agent_local_event_detail import AgentLocalEventDetail from thousandeyes_sdk.event_detection.models.agent_local_event_grouping import AgentLocalEventGrouping -from thousandeyes_sdk.event_detection.models.api_affected_agent import ApiAffectedAgent from thousandeyes_sdk.event_detection.models.api_affected_target import ApiAffectedTarget -from thousandeyes_sdk.event_detection.models.api_affected_test import ApiAffectedTest from thousandeyes_sdk.event_detection.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType from thousandeyes_sdk.event_detection.models.dns_event_detail import DnsEventDetail from thousandeyes_sdk.event_detection.models.dns_event_grouping import DnsEventGrouping from thousandeyes_sdk.event_detection.models.error import Error from thousandeyes_sdk.event_detection.models.event import Event +from thousandeyes_sdk.event_detection.models.event_alert_severity import EventAlertSeverity +from thousandeyes_sdk.event_detection.models.event_api_affected_agent import EventApiAffectedAgent +from thousandeyes_sdk.event_detection.models.event_api_affected_test import EventApiAffectedTest from thousandeyes_sdk.event_detection.models.event_detail import EventDetail from thousandeyes_sdk.event_detection.models.event_detail_base import EventDetailBase from thousandeyes_sdk.event_detection.models.event_state import EventState +from thousandeyes_sdk.event_detection.models.event_test_links import EventTestLinks from thousandeyes_sdk.event_detection.models.event_type import EventType from thousandeyes_sdk.event_detection.models.events import Events from thousandeyes_sdk.event_detection.models.link import Link @@ -41,13 +43,11 @@ from thousandeyes_sdk.event_detection.models.proxy_event_detail import ProxyEventDetail from thousandeyes_sdk.event_detection.models.proxy_event_grouping import ProxyEventGrouping from thousandeyes_sdk.event_detection.models.self_links import SelfLinks -from thousandeyes_sdk.event_detection.models.severity import Severity from thousandeyes_sdk.event_detection.models.simple_event_detail import SimpleEventDetail from thousandeyes_sdk.event_detection.models.target_event_detail import TargetEventDetail from thousandeyes_sdk.event_detection.models.target_event_grouping import TargetEventGrouping from thousandeyes_sdk.event_detection.models.target_network_event_detail import TargetNetworkEventDetail from thousandeyes_sdk.event_detection.models.target_network_event_grouping import TargetNetworkEventGrouping -from thousandeyes_sdk.event_detection.models.test_links import TestLinks from thousandeyes_sdk.event_detection.models.test_type import TestType from thousandeyes_sdk.event_detection.models.unauthorized_error import UnauthorizedError from thousandeyes_sdk.event_detection.models.validation_error import ValidationError diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_agents.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_agents.py index 2f1df7bc8..357aaf2c4 100644 --- a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_agents.py +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_agents.py @@ -18,7 +18,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.event_detection.models.api_affected_agent import ApiAffectedAgent +from thousandeyes_sdk.event_detection.models.event_api_affected_agent import EventApiAffectedAgent from typing import Optional, Set from typing_extensions import Self @@ -28,7 +28,7 @@ class AffectedAgents(BaseModel): """ # noqa: E501 total: Optional[StrictInt] = Field(default=None, description="The total number affected.") in_account_group: Optional[StrictInt] = Field(default=None, description="Indicates if in the affected account group.", alias="inAccountGroup") - agents: Optional[List[ApiAffectedAgent]] = Field(default=None, description="List of affected agents.") + agents: Optional[List[EventApiAffectedAgent]] = Field(default=None, description="List of affected agents.") __properties: ClassVar[List[str]] = ["total", "inAccountGroup", "agents"] model_config = ConfigDict( @@ -96,7 +96,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "total": obj.get("total"), "inAccountGroup": obj.get("inAccountGroup"), - "agents": [ApiAffectedAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "agents": [EventApiAffectedAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None }) return _obj diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_tests.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_tests.py index 96bb31d3c..83ad47617 100644 --- a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_tests.py +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_tests.py @@ -18,7 +18,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.event_detection.models.api_affected_test import ApiAffectedTest +from thousandeyes_sdk.event_detection.models.event_api_affected_test import EventApiAffectedTest from typing import Optional, Set from typing_extensions import Self @@ -28,7 +28,7 @@ class AffectedTests(BaseModel): """ # noqa: E501 total: Optional[StrictInt] = Field(default=None, description="The total number affected.") in_account_group: Optional[StrictInt] = Field(default=None, description="Indicates if in the affected account group.", alias="inAccountGroup") - tests: Optional[List[ApiAffectedTest]] = Field(default=None, description="List of affected tests.") + tests: Optional[List[EventApiAffectedTest]] = Field(default=None, description="List of affected tests.") __properties: ClassVar[List[str]] = ["total", "inAccountGroup", "tests"] model_config = ConfigDict( @@ -96,7 +96,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "total": obj.get("total"), "inAccountGroup": obj.get("inAccountGroup"), - "tests": [ApiAffectedTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None + "tests": [EventApiAffectedTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None }) return _obj diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/agent_local_event_detail.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/agent_local_event_detail.py index 391de1fe0..4cfc062c8 100644 --- a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/agent_local_event_detail.py +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/agent_local_event_detail.py @@ -24,9 +24,9 @@ from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests from thousandeyes_sdk.event_detection.models.agent_local_event_grouping import AgentLocalEventGrouping +from thousandeyes_sdk.event_detection.models.event_alert_severity import EventAlertSeverity from thousandeyes_sdk.event_detection.models.event_state import EventState from thousandeyes_sdk.event_detection.models.self_links import SelfLinks -from thousandeyes_sdk.event_detection.models.severity import Severity from typing import Optional, Set from typing_extensions import Self @@ -39,7 +39,7 @@ class AgentLocalEventDetail(BaseModel): state: Optional[EventState] = None start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") - severity: Optional[Severity] = None + severity: Optional[EventAlertSeverity] = None aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") summary: Optional[StrictStr] = Field(default=None, description="A brief summary describing the cause of the event.") affected_tests: Optional[AffectedTests] = Field(default=None, alias="affectedTests") diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/dns_event_detail.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/dns_event_detail.py index 9a006e600..1f0de03af 100644 --- a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/dns_event_detail.py +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/dns_event_detail.py @@ -24,9 +24,9 @@ from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests from thousandeyes_sdk.event_detection.models.dns_event_grouping import DnsEventGrouping +from thousandeyes_sdk.event_detection.models.event_alert_severity import EventAlertSeverity from thousandeyes_sdk.event_detection.models.event_state import EventState from thousandeyes_sdk.event_detection.models.self_links import SelfLinks -from thousandeyes_sdk.event_detection.models.severity import Severity from typing import Optional, Set from typing_extensions import Self @@ -39,7 +39,7 @@ class DnsEventDetail(BaseModel): state: Optional[EventState] = None start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") - severity: Optional[Severity] = None + severity: Optional[EventAlertSeverity] = None aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") summary: Optional[StrictStr] = Field(default=None, description="A brief summary describing the cause of the event.") affected_tests: Optional[AffectedTests] = Field(default=None, alias="affectedTests") diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event.py index b287d8265..4ba4e2991 100644 --- a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event.py +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event.py @@ -20,10 +20,10 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from thousandeyes_sdk.event_detection.models.affected_count import AffectedCount +from thousandeyes_sdk.event_detection.models.event_alert_severity import EventAlertSeverity from thousandeyes_sdk.event_detection.models.event_state import EventState from thousandeyes_sdk.event_detection.models.event_type import EventType from thousandeyes_sdk.event_detection.models.self_links import SelfLinks -from thousandeyes_sdk.event_detection.models.severity import Severity from typing import Optional, Set from typing_extensions import Self @@ -36,7 +36,7 @@ class Event(BaseModel): state: Optional[EventState] = None start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") - severity: Optional[Severity] = None + severity: Optional[EventAlertSeverity] = None title: Optional[StrictStr] = Field(default=None, description="Event title") type: Optional[EventType] = None affected_tests: Optional[AffectedCount] = Field(default=None, alias="affectedTests") diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_alert_severity.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_alert_severity.py new file mode 100644 index 000000000..26092a496 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_alert_severity.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Event Detection API + + Event detection occurs when ThousandEyes identifies that error signals related to a component (proxy, network node, AS, server etc) have deviated from the baselines established by events. * To determine this, ThousandEyes takes the test results from all accounts groups within an organization, and analyzes that data. * Noisy test results (those that have too many errors in a short window) are removed until they stabilize, and the rest of the results are tagged with the components associated with that test result (for example, proxy, network, or server). * Next, any increase in failures from the test results and each component helps in determining the problem domain and which component may be at fault. * When this failure rate increases beyond a pre-defined threshold (set by the algorithm), an event is triggered and an email notification is sent to the user (if they've enabled email alerts). With the Events API, you can perform the following tasks on the ThousandEyes platform: * **Retrieve Events**: Obtain a list of events and detailed information for each event. For more information about events, see [Event Detection](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class EventAlertSeverity(str, Enum): + """ + The severity of the alert. + """ + + """ + allowed enum values + """ + HIGH = 'high' + MEDIUM = 'medium' + LOW = 'low' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EventAlertSeverity from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_api_affected_agent.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_api_affected_agent.py new file mode 100644 index 000000000..fa8f4b1f6 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_api_affected_agent.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Event Detection API + + Event detection occurs when ThousandEyes identifies that error signals related to a component (proxy, network node, AS, server etc) have deviated from the baselines established by events. * To determine this, ThousandEyes takes the test results from all accounts groups within an organization, and analyzes that data. * Noisy test results (those that have too many errors in a short window) are removed until they stabilize, and the rest of the results are tagged with the components associated with that test result (for example, proxy, network, or server). * Next, any increase in failures from the test results and each component helps in determining the problem domain and which component may be at fault. * When this failure rate increases beyond a pre-defined threshold (set by the algorithm), an event is triggered and an email notification is sent to the user (if they've enabled email alerts). With the Events API, you can perform the following tasks on the ThousandEyes platform: * **Retrieve Events**: Obtain a list of events and detailed information for each event. For more information about events, see [Event Detection](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.agent_links import AgentLinks +from thousandeyes_sdk.event_detection.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from typing import Optional, Set +from typing_extensions import Self + +class EventApiAffectedAgent(BaseModel): + """ + EventApiAffectedAgent + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="The ID of the virtual agent.", alias="agentId") + type: Optional[CloudEnterpriseAgentType] = None + name: Optional[StrictStr] = Field(default=None, description="The name of the agent as defined in settings.") + location: Optional[StrictStr] = Field(default=None, description="The name of the agent's location.") + country_code: Optional[StrictStr] = Field(default=None, description="The country code of the agent's location .", alias="countryCode") + affected_target_ids: Optional[List[StrictStr]] = Field(default=None, description="An array of unique target IDs that contributed data points which generated the signal for the event.", alias="affectedTargetIds") + affected_test_ids: Optional[List[StrictStr]] = Field(default=None, description="An array of unique agent IDs that contributed data points which generated the signal for the event.", alias="affectedTestIds") + links: Optional[AgentLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["agentId", "type", "name", "location", "countryCode", "affectedTargetIds", "affectedTestIds", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EventApiAffectedAgent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "agent_id", + "name", + "location", + "country_code", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventApiAffectedAgent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "type": obj.get("type"), + "name": obj.get("name"), + "location": obj.get("location"), + "countryCode": obj.get("countryCode"), + "affectedTargetIds": obj.get("affectedTargetIds"), + "affectedTestIds": obj.get("affectedTestIds"), + "_links": AgentLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_api_affected_test.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_api_affected_test.py new file mode 100644 index 000000000..1027e2165 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_api_affected_test.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Event Detection API + + Event detection occurs when ThousandEyes identifies that error signals related to a component (proxy, network node, AS, server etc) have deviated from the baselines established by events. * To determine this, ThousandEyes takes the test results from all accounts groups within an organization, and analyzes that data. * Noisy test results (those that have too many errors in a short window) are removed until they stabilize, and the rest of the results are tagged with the components associated with that test result (for example, proxy, network, or server). * Next, any increase in failures from the test results and each component helps in determining the problem domain and which component may be at fault. * When this failure rate increases beyond a pre-defined threshold (set by the algorithm), an event is triggered and an email notification is sent to the user (if they've enabled email alerts). With the Events API, you can perform the following tasks on the ThousandEyes platform: * **Retrieve Events**: Obtain a list of events and detailed information for each event. For more information about events, see [Event Detection](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.event_test_links import EventTestLinks +from thousandeyes_sdk.event_detection.models.test_type import TestType +from typing import Optional, Set +from typing_extensions import Self + +class EventApiAffectedTest(BaseModel): + """ + EventApiAffectedTest + """ # noqa: E501 + test_id: Optional[StrictStr] = Field(default=None, description="The ID of the affected test.", alias="testId") + test_type: Optional[TestType] = Field(default=None, alias="testType") + name: Optional[StrictStr] = Field(default=None, description="The test name as configured in the test settings.") + affected_target_ids: Optional[List[StrictStr]] = Field(default=None, description="An array of unique target IDs contributed data points which generated the signal for the event.", alias="affectedTargetIds") + affected_agent_ids: Optional[List[StrictStr]] = Field(default=None, description="An array of unique agent IDs that contributed data points which generated the signal for the event.", alias="affectedAgentIds") + links: Optional[EventTestLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["testId", "testType", "name", "affectedTargetIds", "affectedAgentIds", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EventApiAffectedTest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "test_id", + "name", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventApiAffectedTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "testId": obj.get("testId"), + "testType": obj.get("testType"), + "name": obj.get("name"), + "affectedTargetIds": obj.get("affectedTargetIds"), + "affectedAgentIds": obj.get("affectedAgentIds"), + "_links": EventTestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_detail_base.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_detail_base.py index caa1cd307..298253161 100644 --- a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_detail_base.py +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_detail_base.py @@ -22,9 +22,9 @@ from thousandeyes_sdk.event_detection.models.affected_agents import AffectedAgents from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests +from thousandeyes_sdk.event_detection.models.event_alert_severity import EventAlertSeverity from thousandeyes_sdk.event_detection.models.event_state import EventState from thousandeyes_sdk.event_detection.models.self_links import SelfLinks -from thousandeyes_sdk.event_detection.models.severity import Severity from typing import Optional, Set from typing_extensions import Self @@ -37,7 +37,7 @@ class EventDetailBase(BaseModel): state: Optional[EventState] = None start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") - severity: Optional[Severity] = None + severity: Optional[EventAlertSeverity] = None aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") summary: Optional[StrictStr] = Field(default=None, description="A brief summary describing the cause of the event.") affected_tests: Optional[AffectedTests] = Field(default=None, alias="affectedTests") diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_test_links.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_test_links.py new file mode 100644 index 000000000..289488cc5 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_test_links.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Event Detection API + + Event detection occurs when ThousandEyes identifies that error signals related to a component (proxy, network node, AS, server etc) have deviated from the baselines established by events. * To determine this, ThousandEyes takes the test results from all accounts groups within an organization, and analyzes that data. * Noisy test results (those that have too many errors in a short window) are removed until they stabilize, and the rest of the results are tagged with the components associated with that test result (for example, proxy, network, or server). * Next, any increase in failures from the test results and each component helps in determining the problem domain and which component may be at fault. * When this failure rate increases beyond a pre-defined threshold (set by the algorithm), an event is triggered and an email notification is sent to the user (if they've enabled email alerts). With the Events API, you can perform the following tasks on the ThousandEyes platform: * **Retrieve Events**: Obtain a list of events and detailed information for each event. For more information about events, see [Event Detection](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.link import Link +from typing import Optional, Set +from typing_extensions import Self + +class EventTestLinks(BaseModel): + """ + A links object containing the self link. + """ # noqa: E501 + test: Optional[Link] = None + __properties: ClassVar[List[str]] = ["test"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EventTestLinks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventTestLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "test": Link.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_event_detail.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_event_detail.py index 7f71acb7b..9d3f550c8 100644 --- a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_event_detail.py +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_event_detail.py @@ -23,10 +23,10 @@ from thousandeyes_sdk.event_detection.models.affected_agents import AffectedAgents from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests +from thousandeyes_sdk.event_detection.models.event_alert_severity import EventAlertSeverity from thousandeyes_sdk.event_detection.models.event_state import EventState from thousandeyes_sdk.event_detection.models.network_event_grouping import NetworkEventGrouping from thousandeyes_sdk.event_detection.models.self_links import SelfLinks -from thousandeyes_sdk.event_detection.models.severity import Severity from typing import Optional, Set from typing_extensions import Self @@ -39,7 +39,7 @@ class NetworkEventDetail(BaseModel): state: Optional[EventState] = None start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") - severity: Optional[Severity] = None + severity: Optional[EventAlertSeverity] = None aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") summary: Optional[StrictStr] = Field(default=None, description="A brief summary describing the cause of the event.") affected_tests: Optional[AffectedTests] = Field(default=None, alias="affectedTests") diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_pop_event_detail.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_pop_event_detail.py index 651232564..ae23fd588 100644 --- a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_pop_event_detail.py +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_pop_event_detail.py @@ -23,10 +23,10 @@ from thousandeyes_sdk.event_detection.models.affected_agents import AffectedAgents from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests +from thousandeyes_sdk.event_detection.models.event_alert_severity import EventAlertSeverity from thousandeyes_sdk.event_detection.models.event_state import EventState from thousandeyes_sdk.event_detection.models.network_event_grouping import NetworkEventGrouping from thousandeyes_sdk.event_detection.models.self_links import SelfLinks -from thousandeyes_sdk.event_detection.models.severity import Severity from typing import Optional, Set from typing_extensions import Self @@ -39,7 +39,7 @@ class NetworkPopEventDetail(BaseModel): state: Optional[EventState] = None start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") - severity: Optional[Severity] = None + severity: Optional[EventAlertSeverity] = None aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") summary: Optional[StrictStr] = Field(default=None, description="A brief summary describing the cause of the event.") affected_tests: Optional[AffectedTests] = Field(default=None, alias="affectedTests") diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/proxy_event_detail.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/proxy_event_detail.py index d8f7f70bc..97222663a 100644 --- a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/proxy_event_detail.py +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/proxy_event_detail.py @@ -23,10 +23,10 @@ from thousandeyes_sdk.event_detection.models.affected_agents import AffectedAgents from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests +from thousandeyes_sdk.event_detection.models.event_alert_severity import EventAlertSeverity from thousandeyes_sdk.event_detection.models.event_state import EventState from thousandeyes_sdk.event_detection.models.proxy_event_grouping import ProxyEventGrouping from thousandeyes_sdk.event_detection.models.self_links import SelfLinks -from thousandeyes_sdk.event_detection.models.severity import Severity from typing import Optional, Set from typing_extensions import Self @@ -39,7 +39,7 @@ class ProxyEventDetail(BaseModel): state: Optional[EventState] = None start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") - severity: Optional[Severity] = None + severity: Optional[EventAlertSeverity] = None aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") summary: Optional[StrictStr] = Field(default=None, description="A brief summary describing the cause of the event.") affected_tests: Optional[AffectedTests] = Field(default=None, alias="affectedTests") diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/simple_event_detail.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/simple_event_detail.py index e2ee56830..9070c5898 100644 --- a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/simple_event_detail.py +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/simple_event_detail.py @@ -19,8 +19,8 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.event_alert_severity import EventAlertSeverity from thousandeyes_sdk.event_detection.models.event_state import EventState -from thousandeyes_sdk.event_detection.models.severity import Severity from typing import Optional, Set from typing_extensions import Self @@ -33,7 +33,7 @@ class SimpleEventDetail(BaseModel): state: Optional[EventState] = None start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") - severity: Optional[Severity] = None + severity: Optional[EventAlertSeverity] = None __properties: ClassVar[List[str]] = ["id", "typeName", "state", "startDate", "endDate", "severity"] model_config = ConfigDict( diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_event_detail.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_event_detail.py index 1740e576b..4e46c6cb6 100644 --- a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_event_detail.py +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_event_detail.py @@ -23,9 +23,9 @@ from thousandeyes_sdk.event_detection.models.affected_agents import AffectedAgents from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests +from thousandeyes_sdk.event_detection.models.event_alert_severity import EventAlertSeverity from thousandeyes_sdk.event_detection.models.event_state import EventState from thousandeyes_sdk.event_detection.models.self_links import SelfLinks -from thousandeyes_sdk.event_detection.models.severity import Severity from thousandeyes_sdk.event_detection.models.target_event_grouping import TargetEventGrouping from typing import Optional, Set from typing_extensions import Self @@ -39,7 +39,7 @@ class TargetEventDetail(BaseModel): state: Optional[EventState] = None start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") - severity: Optional[Severity] = None + severity: Optional[EventAlertSeverity] = None aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") summary: Optional[StrictStr] = Field(default=None, description="A brief summary describing the cause of the event.") affected_tests: Optional[AffectedTests] = Field(default=None, alias="affectedTests") diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_network_event_detail.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_network_event_detail.py index 160f34a5b..a27162b50 100644 --- a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_network_event_detail.py +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_network_event_detail.py @@ -23,9 +23,9 @@ from thousandeyes_sdk.event_detection.models.affected_agents import AffectedAgents from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests +from thousandeyes_sdk.event_detection.models.event_alert_severity import EventAlertSeverity from thousandeyes_sdk.event_detection.models.event_state import EventState from thousandeyes_sdk.event_detection.models.self_links import SelfLinks -from thousandeyes_sdk.event_detection.models.severity import Severity from thousandeyes_sdk.event_detection.models.target_network_event_grouping import TargetNetworkEventGrouping from typing import Optional, Set from typing_extensions import Self @@ -39,7 +39,7 @@ class TargetNetworkEventDetail(BaseModel): state: Optional[EventState] = None start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") - severity: Optional[Severity] = None + severity: Optional[EventAlertSeverity] = None aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") summary: Optional[StrictStr] = Field(default=None, description="A brief summary describing the cause of the event.") affected_tests: Optional[AffectedTests] = Field(default=None, alias="affectedTests") diff --git a/thousandeyes-sdk-instant-tests/.openapi-generator/FILES b/thousandeyes-sdk-instant-tests/.openapi-generator/FILES index 3840a1a39..a988ef140 100644 --- a/thousandeyes-sdk-instant-tests/.openapi-generator/FILES +++ b/thousandeyes-sdk-instant-tests/.openapi-generator/FILES @@ -1,21 +1,24 @@ .openapi-generator-ignore MANIFEST.in README.md -docs/APIApi.md -docs/Agent.md +docs/APIInstantTestsApi.md docs/AgentBase.md docs/AgentInterfaces.md -docs/AgentToAgentApi.md +docs/AgentResponse.md docs/AgentToAgentInstantTest.md docs/AgentToAgentInstantTestRequest.md +docs/AgentToAgentInstantTestResponse.md +docs/AgentToAgentInstantTestsApi.md docs/AgentToAgentProperties.md docs/AgentToAgentTestProtocol.md -docs/AgentToServerApi.md docs/AgentToServerInstantTest.md docs/AgentToServerInstantTestRequest.md +docs/AgentToServerInstantTestResponse.md +docs/AgentToServerInstantTestsApi.md docs/AgentToServerProperties.md docs/ApiInstantTest.md docs/ApiInstantTestRequest.md +docs/ApiInstantTestResponse.md docs/ApiPredefinedVariable.md docs/ApiProperties.md docs/ApiRequest.md @@ -27,48 +30,53 @@ docs/ApiRequestHeader.md docs/ApiRequestMethod.md docs/ApiRequestVariable.md docs/CloudEnterpriseAgentType.md -docs/DNSSecurityApi.md -docs/DNSServerApi.md -docs/DNSTraceApi.md +docs/DNSSECInstantTestsApi.md +docs/DNSServerInstantTestsApi.md +docs/DNSTraceInstantTestsApi.md docs/DnsQueryClass.md docs/DnsSecInstantTest.md docs/DnsSecInstantTestRequest.md +docs/DnsSecInstantTestResponse.md docs/DnsSecProperties.md docs/DnsServerInstantTest.md docs/DnsServerInstantTestRequest.md +docs/DnsServerInstantTestResponse.md docs/DnsServerProperties.md docs/DnsServersRequest.md docs/DnsTraceInstantTest.md docs/DnsTraceInstantTestRequest.md +docs/DnsTraceInstantTestResponse.md docs/DnsTraceProperties.md docs/Error.md -docs/Expand.md -docs/FTPServerApi.md +docs/ExpandInstantTestOptions.md +docs/FTPServerInstantTestsApi.md docs/FtpServerInstantTest.md +docs/FtpServerInstantTestRequest.md +docs/FtpServerInstantTestResponse.md docs/FtpServerProperties.md docs/FtpServerRequestType.md -docs/HTTPPageLoadApi.md -docs/HTTPServerApi.md +docs/HTTPPageLoadInstantTestsApi.md +docs/HTTPServerInstantTestsApi.md docs/HttpServerBaseProperties.md docs/HttpServerInstantTest.md docs/HttpServerInstantTestRequest.md +docs/HttpServerInstantTestResponse.md docs/HttpServerProperties.md docs/InstantTest.md docs/InstantTestRequest.md +docs/InstantTestsApi.md docs/Link.md docs/OAuth.md docs/PageLoadInstantTest.md docs/PageLoadInstantTestRequest.md +docs/PageLoadInstantTestResponse.md docs/PageLoadProperties.md docs/RequestMethod.md -docs/RunApi.md -docs/SIPServerApi.md -docs/ServerInstantTestRequest.md +docs/SIPServerInstantTestsApi.md docs/SharedWithAccount.md docs/SimpleAgent.md docs/SipServerInstantTest.md docs/SipServerInstantTestRequest.md -docs/SipServerInstantTestRequest1.md docs/SipServerInstantTestResponse.md docs/SipServerProperties.md docs/SipTestProtocol.md @@ -94,44 +102,49 @@ docs/UnauthorizedError.md docs/UnexpandedInstantTest.md docs/ValidationError.md docs/ValidationErrorItem.md -docs/VoiceApi.md docs/VoiceInstantTest.md docs/VoiceInstantTestRequest.md +docs/VoiceInstantTestResponse.md +docs/VoiceInstantTestsApi.md docs/VoiceProperties.md -docs/WebTransactionApi.md docs/WebTransactionInstantTest.md docs/WebTransactionInstantTestRequest.md +docs/WebTransactionInstantTestResponse.md +docs/WebTransactionInstantTestsApi.md docs/WebTransactionProperties.md pyproject.toml setup.cfg src/thousandeyes_sdk/instant_tests/__init__.py src/thousandeyes_sdk/instant_tests/api/__init__.py -src/thousandeyes_sdk/instant_tests/api/agent_to_agent_api.py -src/thousandeyes_sdk/instant_tests/api/agent_to_server_api.py -src/thousandeyes_sdk/instant_tests/api/api_api.py -src/thousandeyes_sdk/instant_tests/api/dns_security_api.py -src/thousandeyes_sdk/instant_tests/api/dns_server_api.py -src/thousandeyes_sdk/instant_tests/api/dns_trace_api.py -src/thousandeyes_sdk/instant_tests/api/ftp_server_api.py -src/thousandeyes_sdk/instant_tests/api/http_page_load_api.py -src/thousandeyes_sdk/instant_tests/api/http_server_api.py -src/thousandeyes_sdk/instant_tests/api/run_api.py -src/thousandeyes_sdk/instant_tests/api/sip_server_api.py -src/thousandeyes_sdk/instant_tests/api/voice_api.py -src/thousandeyes_sdk/instant_tests/api/web_transaction_api.py +src/thousandeyes_sdk/instant_tests/api/agent_to_agent_instant_tests_api.py +src/thousandeyes_sdk/instant_tests/api/agent_to_server_instant_tests_api.py +src/thousandeyes_sdk/instant_tests/api/api_instant_tests_api.py +src/thousandeyes_sdk/instant_tests/api/dns_server_instant_tests_api.py +src/thousandeyes_sdk/instant_tests/api/dns_trace_instant_tests_api.py +src/thousandeyes_sdk/instant_tests/api/dnssec_instant_tests_api.py +src/thousandeyes_sdk/instant_tests/api/ftp_server_instant_tests_api.py +src/thousandeyes_sdk/instant_tests/api/http_page_load_instant_tests_api.py +src/thousandeyes_sdk/instant_tests/api/http_server_instant_tests_api.py +src/thousandeyes_sdk/instant_tests/api/instant_tests_api.py +src/thousandeyes_sdk/instant_tests/api/sip_server_instant_tests_api.py +src/thousandeyes_sdk/instant_tests/api/voice_instant_tests_api.py +src/thousandeyes_sdk/instant_tests/api/web_transaction_instant_tests_api.py src/thousandeyes_sdk/instant_tests/models/__init__.py -src/thousandeyes_sdk/instant_tests/models/agent.py src/thousandeyes_sdk/instant_tests/models/agent_base.py src/thousandeyes_sdk/instant_tests/models/agent_interfaces.py +src/thousandeyes_sdk/instant_tests/models/agent_response.py src/thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test.py src/thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test_request.py +src/thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test_response.py src/thousandeyes_sdk/instant_tests/models/agent_to_agent_properties.py src/thousandeyes_sdk/instant_tests/models/agent_to_agent_test_protocol.py src/thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test.py src/thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test_request.py +src/thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test_response.py src/thousandeyes_sdk/instant_tests/models/agent_to_server_properties.py src/thousandeyes_sdk/instant_tests/models/api_instant_test.py src/thousandeyes_sdk/instant_tests/models/api_instant_test_request.py +src/thousandeyes_sdk/instant_tests/models/api_instant_test_response.py src/thousandeyes_sdk/instant_tests/models/api_predefined_variable.py src/thousandeyes_sdk/instant_tests/models/api_properties.py src/thousandeyes_sdk/instant_tests/models/api_request.py @@ -146,22 +159,28 @@ src/thousandeyes_sdk/instant_tests/models/cloud_enterprise_agent_type.py src/thousandeyes_sdk/instant_tests/models/dns_query_class.py src/thousandeyes_sdk/instant_tests/models/dns_sec_instant_test.py src/thousandeyes_sdk/instant_tests/models/dns_sec_instant_test_request.py +src/thousandeyes_sdk/instant_tests/models/dns_sec_instant_test_response.py src/thousandeyes_sdk/instant_tests/models/dns_sec_properties.py src/thousandeyes_sdk/instant_tests/models/dns_server_instant_test.py src/thousandeyes_sdk/instant_tests/models/dns_server_instant_test_request.py +src/thousandeyes_sdk/instant_tests/models/dns_server_instant_test_response.py src/thousandeyes_sdk/instant_tests/models/dns_server_properties.py src/thousandeyes_sdk/instant_tests/models/dns_servers_request.py src/thousandeyes_sdk/instant_tests/models/dns_trace_instant_test.py src/thousandeyes_sdk/instant_tests/models/dns_trace_instant_test_request.py +src/thousandeyes_sdk/instant_tests/models/dns_trace_instant_test_response.py src/thousandeyes_sdk/instant_tests/models/dns_trace_properties.py src/thousandeyes_sdk/instant_tests/models/error.py -src/thousandeyes_sdk/instant_tests/models/expand.py +src/thousandeyes_sdk/instant_tests/models/expand_instant_test_options.py src/thousandeyes_sdk/instant_tests/models/ftp_server_instant_test.py +src/thousandeyes_sdk/instant_tests/models/ftp_server_instant_test_request.py +src/thousandeyes_sdk/instant_tests/models/ftp_server_instant_test_response.py src/thousandeyes_sdk/instant_tests/models/ftp_server_properties.py src/thousandeyes_sdk/instant_tests/models/ftp_server_request_type.py src/thousandeyes_sdk/instant_tests/models/http_server_base_properties.py src/thousandeyes_sdk/instant_tests/models/http_server_instant_test.py src/thousandeyes_sdk/instant_tests/models/http_server_instant_test_request.py +src/thousandeyes_sdk/instant_tests/models/http_server_instant_test_response.py src/thousandeyes_sdk/instant_tests/models/http_server_properties.py src/thousandeyes_sdk/instant_tests/models/instant_test.py src/thousandeyes_sdk/instant_tests/models/instant_test_request.py @@ -169,14 +188,13 @@ src/thousandeyes_sdk/instant_tests/models/link.py src/thousandeyes_sdk/instant_tests/models/o_auth.py src/thousandeyes_sdk/instant_tests/models/page_load_instant_test.py src/thousandeyes_sdk/instant_tests/models/page_load_instant_test_request.py +src/thousandeyes_sdk/instant_tests/models/page_load_instant_test_response.py src/thousandeyes_sdk/instant_tests/models/page_load_properties.py src/thousandeyes_sdk/instant_tests/models/request_method.py -src/thousandeyes_sdk/instant_tests/models/server_instant_test_request.py src/thousandeyes_sdk/instant_tests/models/shared_with_account.py src/thousandeyes_sdk/instant_tests/models/simple_agent.py src/thousandeyes_sdk/instant_tests/models/sip_server_instant_test.py src/thousandeyes_sdk/instant_tests/models/sip_server_instant_test_request.py -src/thousandeyes_sdk/instant_tests/models/sip_server_instant_test_request1.py src/thousandeyes_sdk/instant_tests/models/sip_server_instant_test_response.py src/thousandeyes_sdk/instant_tests/models/sip_server_properties.py src/thousandeyes_sdk/instant_tests/models/sip_test_protocol.py @@ -204,23 +222,25 @@ src/thousandeyes_sdk/instant_tests/models/validation_error.py src/thousandeyes_sdk/instant_tests/models/validation_error_item.py src/thousandeyes_sdk/instant_tests/models/voice_instant_test.py src/thousandeyes_sdk/instant_tests/models/voice_instant_test_request.py +src/thousandeyes_sdk/instant_tests/models/voice_instant_test_response.py src/thousandeyes_sdk/instant_tests/models/voice_properties.py src/thousandeyes_sdk/instant_tests/models/web_transaction_instant_test.py src/thousandeyes_sdk/instant_tests/models/web_transaction_instant_test_request.py +src/thousandeyes_sdk/instant_tests/models/web_transaction_instant_test_response.py src/thousandeyes_sdk/instant_tests/models/web_transaction_properties.py src/thousandeyes_sdk/instant_tests/py.typed test/__init__.py -test/test_agent_to_agent_api.py -test/test_agent_to_server_api.py -test/test_api_api.py -test/test_dns_security_api.py -test/test_dns_server_api.py -test/test_dns_trace_api.py -test/test_ftp_server_api.py -test/test_http_page_load_api.py -test/test_http_server_api.py -test/test_run_api.py -test/test_sip_server_api.py +test/test_agent_to_agent_instant_tests_api.py +test/test_agent_to_server_instant_tests_api.py +test/test_api_instant_tests_api.py +test/test_dns_server_instant_tests_api.py +test/test_dns_trace_instant_tests_api.py +test/test_dnssec_instant_tests_api.py +test/test_ftp_server_instant_tests_api.py +test/test_http_page_load_instant_tests_api.py +test/test_http_server_instant_tests_api.py +test/test_instant_tests_api.py +test/test_sip_server_instant_tests_api.py test/test_utils.py -test/test_voice_api.py -test/test_web_transaction_api.py +test/test_voice_instant_tests_api.py +test/test_web_transaction_instant_tests_api.py diff --git a/thousandeyes-sdk-instant-tests/README.md b/thousandeyes-sdk-instant-tests/README.md index 5ec997f61..f1aa270cb 100644 --- a/thousandeyes-sdk-instant-tests/README.md +++ b/thousandeyes-sdk-instant-tests/README.md @@ -8,7 +8,7 @@ The response does not include the immediate test results. Use the Test Results e This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -80,18 +80,18 @@ configuration = thousandeyes_sdk.core.Configuration( # Enter a context with an instance of the API client with thousandeyes_sdk.core.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.instant_tests.APIApi(api_client) + api_instance = thousandeyes_sdk.instant_tests.APIInstantTestsApi(api_client) api_instant_test_request = thousandeyes_sdk.instant_tests.ApiInstantTestRequest() # ApiInstantTestRequest | aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) - expand = [thousandeyes_sdk.instant_tests.Expand()] # List[Expand] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + expand = [thousandeyes_sdk.instant_tests.ExpandInstantTestOptions()] # List[ExpandInstantTestOptions] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) try: # Create API instant test api_response = api_instance.create_api_instant_test(api_instant_test_request, aid=aid, expand=expand) - print("The response of APIApi->create_api_instant_test:\n") + print("The response of APIInstantTestsApi->create_api_instant_test:\n") pprint(api_response) except ApiException as e: - print("Exception when calling APIApi->create_api_instant_test: %s\n" % e) + print("Exception when calling APIInstantTestsApi->create_api_instant_test: %s\n" % e) ``` @@ -101,35 +101,38 @@ All URIs are relative to *https://api.thousandeyes.com/v7* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*APIApi* | [**create_api_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/APIApi.md#create_api_instant_test) | **POST** /tests/api/instant | Create API instant test -*AgentToAgentApi* | [**create_agent_to_agent_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/AgentToAgentApi.md#create_agent_to_agent_instant_test) | **POST** /tests/agent-to-agent/instant | Create agent-to-agent instant test -*AgentToServerApi* | [**create_agent_to_server_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/AgentToServerApi.md#create_agent_to_server_instant_test) | **POST** /tests/agent-to-server/instant | Create agent-to-server instant test -*DNSSecurityApi* | [**create_dns_sec_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DNSSecurityApi.md#create_dns_sec_instant_test) | **POST** /tests/dnssec/instant | Create DNS security instant test -*DNSServerApi* | [**create_dns_server_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DNSServerApi.md#create_dns_server_instant_test) | **POST** /tests/dns-server/instant | Create DNS server instant test -*DNSTraceApi* | [**create_dns_trace_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DNSTraceApi.md#create_dns_trace_instant_test) | **POST** /tests/dns-trace/instant | Create DNS trace instant test -*FTPServerApi* | [**create_ftp_server_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/FTPServerApi.md#create_ftp_server_instant_test) | **POST** /tests/ftp-server/instant | Create FTP server instant test -*HTTPPageLoadApi* | [**create_page_load_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/HTTPPageLoadApi.md#create_page_load_instant_test) | **POST** /tests/page-load/instant | Create HTTP page load instant test -*HTTPServerApi* | [**create_http_server_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/HTTPServerApi.md#create_http_server_instant_test) | **POST** /tests/http-server/instant | Create HTTP server instant test -*RunApi* | [**run_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/RunApi.md#run_instant_test) | **POST** /tests/{testId}/run | Run instant test -*SIPServerApi* | [**create_sip_server_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/SIPServerApi.md#create_sip_server_instant_test) | **POST** /tests/sip-server/instant | Create SIP server instant test -*VoiceApi* | [**create_voice_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/VoiceApi.md#create_voice_instant_test) | **POST** /tests/voice/instant | Create voice instant test -*WebTransactionApi* | [**create_web_transaction_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/WebTransactionApi.md#create_web_transaction_instant_test) | **POST** /tests/web-transactions/instant | Create web transactions instant test +*APIInstantTestsApi* | [**create_api_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/APIInstantTestsApi.md#create_api_instant_test) | **POST** /tests/api/instant | Create API instant test +*AgentToAgentInstantTestsApi* | [**create_agent_to_agent_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/AgentToAgentInstantTestsApi.md#create_agent_to_agent_instant_test) | **POST** /tests/agent-to-agent/instant | Create agent-to-agent instant test +*AgentToServerInstantTestsApi* | [**create_agent_to_server_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/AgentToServerInstantTestsApi.md#create_agent_to_server_instant_test) | **POST** /tests/agent-to-server/instant | Create agent-to-server instant test +*DNSSECInstantTestsApi* | [**create_dns_sec_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DNSSECInstantTestsApi.md#create_dns_sec_instant_test) | **POST** /tests/dnssec/instant | Create DNSSEC instant test +*DNSServerInstantTestsApi* | [**create_dns_server_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DNSServerInstantTestsApi.md#create_dns_server_instant_test) | **POST** /tests/dns-server/instant | Create DNS server instant test +*DNSTraceInstantTestsApi* | [**create_dns_trace_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DNSTraceInstantTestsApi.md#create_dns_trace_instant_test) | **POST** /tests/dns-trace/instant | Create DNS trace instant test +*FTPServerInstantTestsApi* | [**create_ftp_server_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/FTPServerInstantTestsApi.md#create_ftp_server_instant_test) | **POST** /tests/ftp-server/instant | Create FTP server instant test +*HTTPPageLoadInstantTestsApi* | [**create_page_load_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/HTTPPageLoadInstantTestsApi.md#create_page_load_instant_test) | **POST** /tests/page-load/instant | Create HTTP page load instant test +*HTTPServerInstantTestsApi* | [**create_http_server_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/HTTPServerInstantTestsApi.md#create_http_server_instant_test) | **POST** /tests/http-server/instant | Create HTTP server instant test +*InstantTestsApi* | [**run_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/InstantTestsApi.md#run_instant_test) | **POST** /tests/{testId}/run | Run instant test +*SIPServerInstantTestsApi* | [**create_sip_server_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/SIPServerInstantTestsApi.md#create_sip_server_instant_test) | **POST** /tests/sip-server/instant | Create SIP server instant test +*VoiceInstantTestsApi* | [**create_voice_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/VoiceInstantTestsApi.md#create_voice_instant_test) | **POST** /tests/voice/instant | Create voice instant test +*WebTransactionInstantTestsApi* | [**create_web_transaction_instant_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTestsApi.md#create_web_transaction_instant_test) | **POST** /tests/web-transactions/instant | Create web transactions instant test ## Documentation For Models - - [Agent](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/Agent.md) - [AgentBase](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/AgentBase.md) - [AgentInterfaces](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/AgentInterfaces.md) + - [AgentResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/AgentResponse.md) - [AgentToAgentInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/AgentToAgentInstantTest.md) - [AgentToAgentInstantTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/AgentToAgentInstantTestRequest.md) + - [AgentToAgentInstantTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/AgentToAgentInstantTestResponse.md) - [AgentToAgentProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/AgentToAgentProperties.md) - [AgentToAgentTestProtocol](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/AgentToAgentTestProtocol.md) - [AgentToServerInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/AgentToServerInstantTest.md) - [AgentToServerInstantTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/AgentToServerInstantTestRequest.md) + - [AgentToServerInstantTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/AgentToServerInstantTestResponse.md) - [AgentToServerProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/AgentToServerProperties.md) - [ApiInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/ApiInstantTest.md) - [ApiInstantTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/ApiInstantTestRequest.md) + - [ApiInstantTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/ApiInstantTestResponse.md) - [ApiPredefinedVariable](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/ApiPredefinedVariable.md) - [ApiProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/ApiProperties.md) - [ApiRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/ApiRequest.md) @@ -144,22 +147,28 @@ Class | Method | HTTP request | Description - [DnsQueryClass](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DnsQueryClass.md) - [DnsSecInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DnsSecInstantTest.md) - [DnsSecInstantTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DnsSecInstantTestRequest.md) + - [DnsSecInstantTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DnsSecInstantTestResponse.md) - [DnsSecProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DnsSecProperties.md) - [DnsServerInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DnsServerInstantTest.md) - [DnsServerInstantTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DnsServerInstantTestRequest.md) + - [DnsServerInstantTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DnsServerInstantTestResponse.md) - [DnsServerProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DnsServerProperties.md) - [DnsServersRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DnsServersRequest.md) - [DnsTraceInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DnsTraceInstantTest.md) - [DnsTraceInstantTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DnsTraceInstantTestRequest.md) + - [DnsTraceInstantTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DnsTraceInstantTestResponse.md) - [DnsTraceProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/DnsTraceProperties.md) - [Error](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/Error.md) - - [Expand](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/Expand.md) + - [ExpandInstantTestOptions](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/ExpandInstantTestOptions.md) - [FtpServerInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/FtpServerInstantTest.md) + - [FtpServerInstantTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/FtpServerInstantTestRequest.md) + - [FtpServerInstantTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/FtpServerInstantTestResponse.md) - [FtpServerProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/FtpServerProperties.md) - [FtpServerRequestType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/FtpServerRequestType.md) - [HttpServerBaseProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/HttpServerBaseProperties.md) - [HttpServerInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/HttpServerInstantTest.md) - [HttpServerInstantTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/HttpServerInstantTestRequest.md) + - [HttpServerInstantTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/HttpServerInstantTestResponse.md) - [HttpServerProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/HttpServerProperties.md) - [InstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/InstantTest.md) - [InstantTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/InstantTestRequest.md) @@ -167,14 +176,13 @@ Class | Method | HTTP request | Description - [OAuth](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/OAuth.md) - [PageLoadInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/PageLoadInstantTest.md) - [PageLoadInstantTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/PageLoadInstantTestRequest.md) + - [PageLoadInstantTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/PageLoadInstantTestResponse.md) - [PageLoadProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/PageLoadProperties.md) - [RequestMethod](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/RequestMethod.md) - - [ServerInstantTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/ServerInstantTestRequest.md) - [SharedWithAccount](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/SharedWithAccount.md) - [SimpleAgent](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/SimpleAgent.md) - [SipServerInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/SipServerInstantTest.md) - [SipServerInstantTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/SipServerInstantTestRequest.md) - - [SipServerInstantTestRequest1](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/SipServerInstantTestRequest1.md) - [SipServerInstantTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/SipServerInstantTestResponse.md) - [SipServerProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/SipServerProperties.md) - [SipTestProtocol](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/SipTestProtocol.md) @@ -202,9 +210,11 @@ Class | Method | HTTP request | Description - [ValidationErrorItem](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/ValidationErrorItem.md) - [VoiceInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/VoiceInstantTest.md) - [VoiceInstantTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/VoiceInstantTestRequest.md) + - [VoiceInstantTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/VoiceInstantTestResponse.md) - [VoiceProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/VoiceProperties.md) - [WebTransactionInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTest.md) - [WebTransactionInstantTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTestRequest.md) + - [WebTransactionInstantTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTestResponse.md) - [WebTransactionProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-instant-tests/docs/WebTransactionProperties.md) diff --git a/thousandeyes-sdk-instant-tests/docs/APIInstantTestsApi.md b/thousandeyes-sdk-instant-tests/docs/APIInstantTestsApi.md new file mode 100644 index 000000000..6b326ba04 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/APIInstantTestsApi.md @@ -0,0 +1,101 @@ +# thousandeyes_sdk.instant_tests.APIInstantTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_api_instant_test**](APIInstantTestsApi.md#create_api_instant_test) | **POST** /tests/api/instant | Create API instant test + + +# **create_api_instant_test** +> ApiInstantTestResponse create_api_instant_test(api_instant_test_request, aid=aid, expand=expand) + +Create API instant test + +Creates and runs a new API instant test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.instant_tests +from thousandeyes_sdk.instant_tests.models.api_instant_test_request import ApiInstantTestRequest +from thousandeyes_sdk.instant_tests.models.api_instant_test_response import ApiInstantTestResponse +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.instant_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.instant_tests.APIInstantTestsApi(api_client) + api_instant_test_request = thousandeyes_sdk.instant_tests.ApiInstantTestRequest() # ApiInstantTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.instant_tests.ExpandInstantTestOptions()] # List[ExpandInstantTestOptions] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create API instant test + api_response = api_instance.create_api_instant_test(api_instant_test_request, aid=aid, expand=expand) + print("The response of APIInstantTestsApi->create_api_instant_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling APIInstantTestsApi->create_api_instant_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **api_instant_test_request** | [**ApiInstantTestRequest**](ApiInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandInstantTestOptions]**](ExpandInstantTestOptions.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**ApiInstantTestResponse**](ApiInstantTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-instant-tests/docs/AgentResponse.md b/thousandeyes-sdk-instant-tests/docs/AgentResponse.md new file mode 100644 index 000000000..9753405cc --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/AgentResponse.md @@ -0,0 +1,39 @@ +# AgentResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly] +**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly] +**network** | **str** | Network (including ASN) of agent’s public IP. | [optional] [readonly] +**agent_id** | **str** | Unique ID of the agent. | [optional] [readonly] +**agent_name** | **str** | Name of the agent. | [optional] +**location** | **str** | Location of the agent. | [optional] [readonly] +**country_id** | **str** | 2-digit ISO country code | [optional] [readonly] +**enabled** | **bool** | Flag indicating if the agent is enabled. | [optional] +**prefix** | **str** | Prefix containing agents public IP address. | [optional] [readonly] +**verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly] +**agent_type** | [**CloudEnterpriseAgentType**](CloudEnterpriseAgentType.md) | | + +## Example + +```python +from thousandeyes_sdk.instant_tests.models.agent_response import AgentResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentResponse from a JSON string +agent_response_instance = AgentResponse.from_json(json) +# print the JSON string representation of the object +print(AgentResponse.to_json()) + +# convert the object into a dict +agent_response_dict = agent_response_instance.to_dict() +# create an instance of AgentResponse from a dict +agent_response_from_dict = AgentResponse.from_dict(agent_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-instant-tests/docs/AgentToAgentInstantTest.md b/thousandeyes-sdk-instant-tests/docs/AgentToAgentInstantTest.md index 242c073ca..e48f718c1 100644 --- a/thousandeyes-sdk-instant-tests/docs/AgentToAgentInstantTest.md +++ b/thousandeyes-sdk-instant-tests/docs/AgentToAgentInstantTest.md @@ -31,7 +31,6 @@ Name | Type | Description | Notes **throughput_duration** | **int** | The throughput duration. | [optional] [default to 10000] **throughput_rate** | **int** | The throughput rate, only applicable for UDP protocol. | [optional] **fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-instant-tests/docs/AgentToAgentInstantTestResponse.md b/thousandeyes-sdk-instant-tests/docs/AgentToAgentInstantTestResponse.md new file mode 100644 index 000000000..ffe2cd6d3 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/AgentToAgentInstantTestResponse.md @@ -0,0 +1,55 @@ +# AgentToAgentInstantTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**mss** | **int** | Maximum segment size, in bytes. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**protocol** | [**AgentToAgentTestProtocol**](AgentToAgentTestProtocol.md) | | [optional] +**target_agent_id** | **str** | `agentId` of the target agent for the test. | +**throughput_measurements** | **bool** | Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent. | [optional] [default to False] +**throughput_duration** | **int** | The throughput duration. | [optional] [default to 10000] +**throughput_rate** | **int** | The throughput rate, only applicable for UDP protocol. | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.instant_tests.models.agent_to_agent_instant_test_response import AgentToAgentInstantTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentToAgentInstantTestResponse from a JSON string +agent_to_agent_instant_test_response_instance = AgentToAgentInstantTestResponse.from_json(json) +# print the JSON string representation of the object +print(AgentToAgentInstantTestResponse.to_json()) + +# convert the object into a dict +agent_to_agent_instant_test_response_dict = agent_to_agent_instant_test_response_instance.to_dict() +# create an instance of AgentToAgentInstantTestResponse from a dict +agent_to_agent_instant_test_response_from_dict = AgentToAgentInstantTestResponse.from_dict(agent_to_agent_instant_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-instant-tests/docs/AgentToAgentInstantTestsApi.md b/thousandeyes-sdk-instant-tests/docs/AgentToAgentInstantTestsApi.md new file mode 100644 index 000000000..b64e87872 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/AgentToAgentInstantTestsApi.md @@ -0,0 +1,101 @@ +# thousandeyes_sdk.instant_tests.AgentToAgentInstantTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_agent_to_agent_instant_test**](AgentToAgentInstantTestsApi.md#create_agent_to_agent_instant_test) | **POST** /tests/agent-to-agent/instant | Create agent-to-agent instant test + + +# **create_agent_to_agent_instant_test** +> AgentToAgentInstantTestResponse create_agent_to_agent_instant_test(agent_to_agent_instant_test_request, aid=aid, expand=expand) + +Create agent-to-agent instant test + +Creates and runs a new agent-to-agent instant test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.instant_tests +from thousandeyes_sdk.instant_tests.models.agent_to_agent_instant_test_request import AgentToAgentInstantTestRequest +from thousandeyes_sdk.instant_tests.models.agent_to_agent_instant_test_response import AgentToAgentInstantTestResponse +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.instant_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.instant_tests.AgentToAgentInstantTestsApi(api_client) + agent_to_agent_instant_test_request = thousandeyes_sdk.instant_tests.AgentToAgentInstantTestRequest() # AgentToAgentInstantTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.instant_tests.ExpandInstantTestOptions()] # List[ExpandInstantTestOptions] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create agent-to-agent instant test + api_response = api_instance.create_agent_to_agent_instant_test(agent_to_agent_instant_test_request, aid=aid, expand=expand) + print("The response of AgentToAgentInstantTestsApi->create_agent_to_agent_instant_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToAgentInstantTestsApi->create_agent_to_agent_instant_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_to_agent_instant_test_request** | [**AgentToAgentInstantTestRequest**](AgentToAgentInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandInstantTestOptions]**](ExpandInstantTestOptions.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**AgentToAgentInstantTestResponse**](AgentToAgentInstantTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-instant-tests/docs/AgentToServerInstantTest.md b/thousandeyes-sdk-instant-tests/docs/AgentToServerInstantTest.md index 291312f2a..70934347f 100644 --- a/thousandeyes-sdk-instant-tests/docs/AgentToServerInstantTest.md +++ b/thousandeyes-sdk-instant-tests/docs/AgentToServerInstantTest.md @@ -33,7 +33,6 @@ Name | Type | Description | Notes **ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] **ping_payload_size** | **int** | Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests. | [optional] **network_measurements** | **bool** | View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements. | [optional] [default to False] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-instant-tests/docs/AgentToServerInstantTestResponse.md b/thousandeyes-sdk-instant-tests/docs/AgentToServerInstantTestResponse.md new file mode 100644 index 000000000..bd703f1a7 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/AgentToServerInstantTestResponse.md @@ -0,0 +1,57 @@ +# AgentToServerInstantTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**continuous_mode** | **bool** | To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. | [optional] +**fixed_packet_rate** | **int** | If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1` | [optional] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**server** | **str** | Target name or IP address. | +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**ping_payload_size** | **int** | Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests. | [optional] +**network_measurements** | **bool** | View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements. | [optional] [default to False] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.instant_tests.models.agent_to_server_instant_test_response import AgentToServerInstantTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentToServerInstantTestResponse from a JSON string +agent_to_server_instant_test_response_instance = AgentToServerInstantTestResponse.from_json(json) +# print the JSON string representation of the object +print(AgentToServerInstantTestResponse.to_json()) + +# convert the object into a dict +agent_to_server_instant_test_response_dict = agent_to_server_instant_test_response_instance.to_dict() +# create an instance of AgentToServerInstantTestResponse from a dict +agent_to_server_instant_test_response_from_dict = AgentToServerInstantTestResponse.from_dict(agent_to_server_instant_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-instant-tests/docs/AgentToServerInstantTestsApi.md b/thousandeyes-sdk-instant-tests/docs/AgentToServerInstantTestsApi.md new file mode 100644 index 000000000..ef722c909 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/AgentToServerInstantTestsApi.md @@ -0,0 +1,101 @@ +# thousandeyes_sdk.instant_tests.AgentToServerInstantTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_agent_to_server_instant_test**](AgentToServerInstantTestsApi.md#create_agent_to_server_instant_test) | **POST** /tests/agent-to-server/instant | Create agent-to-server instant test + + +# **create_agent_to_server_instant_test** +> AgentToServerInstantTestResponse create_agent_to_server_instant_test(agent_to_server_instant_test_request, aid=aid, expand=expand) + +Create agent-to-server instant test + +Creates and runs a new agent-to-server instant test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.instant_tests +from thousandeyes_sdk.instant_tests.models.agent_to_server_instant_test_request import AgentToServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.agent_to_server_instant_test_response import AgentToServerInstantTestResponse +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.instant_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.instant_tests.AgentToServerInstantTestsApi(api_client) + agent_to_server_instant_test_request = thousandeyes_sdk.instant_tests.AgentToServerInstantTestRequest() # AgentToServerInstantTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.instant_tests.ExpandInstantTestOptions()] # List[ExpandInstantTestOptions] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create agent-to-server instant test + api_response = api_instance.create_agent_to_server_instant_test(agent_to_server_instant_test_request, aid=aid, expand=expand) + print("The response of AgentToServerInstantTestsApi->create_agent_to_server_instant_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerInstantTestsApi->create_agent_to_server_instant_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_to_server_instant_test_request** | [**AgentToServerInstantTestRequest**](AgentToServerInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandInstantTestOptions]**](ExpandInstantTestOptions.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**AgentToServerInstantTestResponse**](AgentToServerInstantTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-instant-tests/docs/ApiInstantTest.md b/thousandeyes-sdk-instant-tests/docs/ApiInstantTest.md index d5a6c2afb..0c09b1586 100644 --- a/thousandeyes-sdk-instant-tests/docs/ApiInstantTest.md +++ b/thousandeyes-sdk-instant-tests/docs/ApiInstantTest.md @@ -18,10 +18,13 @@ Name | Type | Description | Notes **links** | [**TestLinks**](TestLinks.md) | | [optional] **labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] **shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] **follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] **mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] **num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] **path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] **predefined_variables** | [**List[ApiPredefinedVariable]**](ApiPredefinedVariable.md) | | [optional] **probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] @@ -31,7 +34,6 @@ Name | Type | Description | Notes **target_time** | **int** | Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior) | [optional] **time_limit** | **int** | Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error. | [optional] [default to 30] **url** | **str** | Target for the test. | -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] **credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] ## Example diff --git a/thousandeyes-sdk-instant-tests/docs/ApiInstantTestRequest.md b/thousandeyes-sdk-instant-tests/docs/ApiInstantTestRequest.md index 5aaecce50..daa51c22d 100644 --- a/thousandeyes-sdk-instant-tests/docs/ApiInstantTestRequest.md +++ b/thousandeyes-sdk-instant-tests/docs/ApiInstantTestRequest.md @@ -18,10 +18,13 @@ Name | Type | Description | Notes **links** | [**TestLinks**](TestLinks.md) | | [optional] **labels** | **List[str]** | A list of test label identifiers (get `labelId` from `/labels` endpoint). | [optional] **shared_with_accounts** | **List[str]** | A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint). | [optional] +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] **follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] **mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] **num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] **path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] **predefined_variables** | [**List[ApiPredefinedVariable]**](ApiPredefinedVariable.md) | | [optional] **probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] @@ -31,8 +34,8 @@ Name | Type | Description | Notes **target_time** | **int** | Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior) | [optional] **time_limit** | **int** | Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error. | [optional] [default to 30] **url** | **str** | Target for the test. | -**agents** | [**List[TestAgent]**](TestAgent.md) | A list of objects with `agentId` (required) and `sourceIpAddress` (optional). | **credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] +**agents** | [**List[TestAgent]**](TestAgent.md) | A list of objects with `agentId` (required) and `sourceIpAddress` (optional). | ## Example diff --git a/thousandeyes-sdk-instant-tests/docs/ApiInstantTestResponse.md b/thousandeyes-sdk-instant-tests/docs/ApiInstantTestResponse.md new file mode 100644 index 000000000..2e03bf00a --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/ApiInstantTestResponse.md @@ -0,0 +1,59 @@ +# ApiInstantTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**predefined_variables** | [**List[ApiPredefinedVariable]**](ApiPredefinedVariable.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**requests** | [**List[ApiRequest]**](ApiRequest.md) | | +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**target_time** | **int** | Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior) | [optional] +**time_limit** | **int** | Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error. | [optional] [default to 30] +**url** | **str** | Target for the test. | +**credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.instant_tests.models.api_instant_test_response import ApiInstantTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiInstantTestResponse from a JSON string +api_instant_test_response_instance = ApiInstantTestResponse.from_json(json) +# print the JSON string representation of the object +print(ApiInstantTestResponse.to_json()) + +# convert the object into a dict +api_instant_test_response_dict = api_instant_test_response_instance.to_dict() +# create an instance of ApiInstantTestResponse from a dict +api_instant_test_response_from_dict = ApiInstantTestResponse.from_dict(api_instant_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-instant-tests/docs/ApiProperties.md b/thousandeyes-sdk-instant-tests/docs/ApiProperties.md index c45753c3f..90b9ff7aa 100644 --- a/thousandeyes-sdk-instant-tests/docs/ApiProperties.md +++ b/thousandeyes-sdk-instant-tests/docs/ApiProperties.md @@ -5,10 +5,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] **follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] **mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] **num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] **path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] **predefined_variables** | [**List[ApiPredefinedVariable]**](ApiPredefinedVariable.md) | | [optional] **probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] diff --git a/thousandeyes-sdk-instant-tests/docs/DNSSECInstantTestsApi.md b/thousandeyes-sdk-instant-tests/docs/DNSSECInstantTestsApi.md new file mode 100644 index 000000000..128c94efa --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/DNSSECInstantTestsApi.md @@ -0,0 +1,101 @@ +# thousandeyes_sdk.instant_tests.DNSSECInstantTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_dns_sec_instant_test**](DNSSECInstantTestsApi.md#create_dns_sec_instant_test) | **POST** /tests/dnssec/instant | Create DNSSEC instant test + + +# **create_dns_sec_instant_test** +> DnsSecInstantTestResponse create_dns_sec_instant_test(dns_sec_instant_test_request, aid=aid, expand=expand) + +Create DNSSEC instant test + +Creates and runs a new DNSSEC instant test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.instant_tests +from thousandeyes_sdk.instant_tests.models.dns_sec_instant_test_request import DnsSecInstantTestRequest +from thousandeyes_sdk.instant_tests.models.dns_sec_instant_test_response import DnsSecInstantTestResponse +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.instant_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.instant_tests.DNSSECInstantTestsApi(api_client) + dns_sec_instant_test_request = thousandeyes_sdk.instant_tests.DnsSecInstantTestRequest() # DnsSecInstantTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.instant_tests.ExpandInstantTestOptions()] # List[ExpandInstantTestOptions] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create DNSSEC instant test + api_response = api_instance.create_dns_sec_instant_test(dns_sec_instant_test_request, aid=aid, expand=expand) + print("The response of DNSSECInstantTestsApi->create_dns_sec_instant_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSSECInstantTestsApi->create_dns_sec_instant_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dns_sec_instant_test_request** | [**DnsSecInstantTestRequest**](DnsSecInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandInstantTestOptions]**](ExpandInstantTestOptions.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**DnsSecInstantTestResponse**](DnsSecInstantTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-instant-tests/docs/DNSServerInstantTestsApi.md b/thousandeyes-sdk-instant-tests/docs/DNSServerInstantTestsApi.md new file mode 100644 index 000000000..ab6d4e362 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/DNSServerInstantTestsApi.md @@ -0,0 +1,101 @@ +# thousandeyes_sdk.instant_tests.DNSServerInstantTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_dns_server_instant_test**](DNSServerInstantTestsApi.md#create_dns_server_instant_test) | **POST** /tests/dns-server/instant | Create DNS server instant test + + +# **create_dns_server_instant_test** +> DnsServerInstantTestResponse create_dns_server_instant_test(dns_server_instant_test_request, aid=aid, expand=expand) + +Create DNS server instant test + +Creates and runs a new DNS server instant test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.instant_tests +from thousandeyes_sdk.instant_tests.models.dns_server_instant_test_request import DnsServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.dns_server_instant_test_response import DnsServerInstantTestResponse +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.instant_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.instant_tests.DNSServerInstantTestsApi(api_client) + dns_server_instant_test_request = thousandeyes_sdk.instant_tests.DnsServerInstantTestRequest() # DnsServerInstantTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.instant_tests.ExpandInstantTestOptions()] # List[ExpandInstantTestOptions] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create DNS server instant test + api_response = api_instance.create_dns_server_instant_test(dns_server_instant_test_request, aid=aid, expand=expand) + print("The response of DNSServerInstantTestsApi->create_dns_server_instant_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSServerInstantTestsApi->create_dns_server_instant_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dns_server_instant_test_request** | [**DnsServerInstantTestRequest**](DnsServerInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandInstantTestOptions]**](ExpandInstantTestOptions.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**DnsServerInstantTestResponse**](DnsServerInstantTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-instant-tests/docs/DNSTraceInstantTestsApi.md b/thousandeyes-sdk-instant-tests/docs/DNSTraceInstantTestsApi.md new file mode 100644 index 000000000..82cc9246f --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/DNSTraceInstantTestsApi.md @@ -0,0 +1,101 @@ +# thousandeyes_sdk.instant_tests.DNSTraceInstantTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_dns_trace_instant_test**](DNSTraceInstantTestsApi.md#create_dns_trace_instant_test) | **POST** /tests/dns-trace/instant | Create DNS trace instant test + + +# **create_dns_trace_instant_test** +> DnsTraceInstantTestResponse create_dns_trace_instant_test(dns_trace_instant_test_request, aid=aid, expand=expand) + +Create DNS trace instant test + +Creates and runs a new DNS trace instant test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.instant_tests +from thousandeyes_sdk.instant_tests.models.dns_trace_instant_test_request import DnsTraceInstantTestRequest +from thousandeyes_sdk.instant_tests.models.dns_trace_instant_test_response import DnsTraceInstantTestResponse +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.instant_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.instant_tests.DNSTraceInstantTestsApi(api_client) + dns_trace_instant_test_request = thousandeyes_sdk.instant_tests.DnsTraceInstantTestRequest() # DnsTraceInstantTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.instant_tests.ExpandInstantTestOptions()] # List[ExpandInstantTestOptions] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create DNS trace instant test + api_response = api_instance.create_dns_trace_instant_test(dns_trace_instant_test_request, aid=aid, expand=expand) + print("The response of DNSTraceInstantTestsApi->create_dns_trace_instant_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSTraceInstantTestsApi->create_dns_trace_instant_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dns_trace_instant_test_request** | [**DnsTraceInstantTestRequest**](DnsTraceInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandInstantTestOptions]**](ExpandInstantTestOptions.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**DnsTraceInstantTestResponse**](DnsTraceInstantTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-instant-tests/docs/DnsSecInstantTest.md b/thousandeyes-sdk-instant-tests/docs/DnsSecInstantTest.md index 17b012157..f0514076a 100644 --- a/thousandeyes-sdk-instant-tests/docs/DnsSecInstantTest.md +++ b/thousandeyes-sdk-instant-tests/docs/DnsSecInstantTest.md @@ -20,7 +20,6 @@ Name | Type | Description | Notes **shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] **domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | **dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-instant-tests/docs/DnsSecInstantTestResponse.md b/thousandeyes-sdk-instant-tests/docs/DnsSecInstantTestResponse.md new file mode 100644 index 000000000..430ed0cb5 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/DnsSecInstantTestResponse.md @@ -0,0 +1,44 @@ +# DnsSecInstantTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.instant_tests.models.dns_sec_instant_test_response import DnsSecInstantTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsSecInstantTestResponse from a JSON string +dns_sec_instant_test_response_instance = DnsSecInstantTestResponse.from_json(json) +# print the JSON string representation of the object +print(DnsSecInstantTestResponse.to_json()) + +# convert the object into a dict +dns_sec_instant_test_response_dict = dns_sec_instant_test_response_instance.to_dict() +# create an instance of DnsSecInstantTestResponse from a dict +dns_sec_instant_test_response_from_dict = DnsSecInstantTestResponse.from_dict(dns_sec_instant_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-instant-tests/docs/DnsServerInstantTest.md b/thousandeyes-sdk-instant-tests/docs/DnsServerInstantTest.md index 8eaed1ab3..38a01aa4c 100644 --- a/thousandeyes-sdk-instant-tests/docs/DnsServerInstantTest.md +++ b/thousandeyes-sdk-instant-tests/docs/DnsServerInstantTest.md @@ -32,7 +32,6 @@ Name | Type | Description | Notes **ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] **fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] **dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-instant-tests/docs/DnsServerInstantTestResponse.md b/thousandeyes-sdk-instant-tests/docs/DnsServerInstantTestResponse.md new file mode 100644 index 000000000..1e00f850c --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/DnsServerInstantTestResponse.md @@ -0,0 +1,56 @@ +# DnsServerInstantTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**dns_servers** | [**List[TestDnsServer]**](TestDnsServer.md) | | +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**recursive_queries** | **bool** | Set true to run query with RD (recursion desired) flag enabled. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.instant_tests.models.dns_server_instant_test_response import DnsServerInstantTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsServerInstantTestResponse from a JSON string +dns_server_instant_test_response_instance = DnsServerInstantTestResponse.from_json(json) +# print the JSON string representation of the object +print(DnsServerInstantTestResponse.to_json()) + +# convert the object into a dict +dns_server_instant_test_response_dict = dns_server_instant_test_response_instance.to_dict() +# create an instance of DnsServerInstantTestResponse from a dict +dns_server_instant_test_response_from_dict = DnsServerInstantTestResponse.from_dict(dns_server_instant_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-instant-tests/docs/DnsTraceInstantTest.md b/thousandeyes-sdk-instant-tests/docs/DnsTraceInstantTest.md index 45ebb8f45..f4bf7ff70 100644 --- a/thousandeyes-sdk-instant-tests/docs/DnsTraceInstantTest.md +++ b/thousandeyes-sdk-instant-tests/docs/DnsTraceInstantTest.md @@ -21,7 +21,6 @@ Name | Type | Description | Notes **dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] **domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | **dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-instant-tests/docs/DnsTraceInstantTestResponse.md b/thousandeyes-sdk-instant-tests/docs/DnsTraceInstantTestResponse.md new file mode 100644 index 000000000..d115d2760 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/DnsTraceInstantTestResponse.md @@ -0,0 +1,45 @@ +# DnsTraceInstantTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.instant_tests.models.dns_trace_instant_test_response import DnsTraceInstantTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsTraceInstantTestResponse from a JSON string +dns_trace_instant_test_response_instance = DnsTraceInstantTestResponse.from_json(json) +# print the JSON string representation of the object +print(DnsTraceInstantTestResponse.to_json()) + +# convert the object into a dict +dns_trace_instant_test_response_dict = dns_trace_instant_test_response_instance.to_dict() +# create an instance of DnsTraceInstantTestResponse from a dict +dns_trace_instant_test_response_from_dict = DnsTraceInstantTestResponse.from_dict(dns_trace_instant_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-instant-tests/docs/ExpandInstantTestOptions.md b/thousandeyes-sdk-instant-tests/docs/ExpandInstantTestOptions.md new file mode 100644 index 000000000..bdc047535 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/ExpandInstantTestOptions.md @@ -0,0 +1,11 @@ +# ExpandInstantTestOptions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-instant-tests/docs/FTPServerInstantTestsApi.md b/thousandeyes-sdk-instant-tests/docs/FTPServerInstantTestsApi.md new file mode 100644 index 000000000..ca3610682 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/FTPServerInstantTestsApi.md @@ -0,0 +1,101 @@ +# thousandeyes_sdk.instant_tests.FTPServerInstantTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_ftp_server_instant_test**](FTPServerInstantTestsApi.md#create_ftp_server_instant_test) | **POST** /tests/ftp-server/instant | Create FTP server instant test + + +# **create_ftp_server_instant_test** +> FtpServerInstantTestResponse create_ftp_server_instant_test(ftp_server_instant_test_request, aid=aid, expand=expand) + +Create FTP server instant test + +Creates and runs a new FTP server instant test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.instant_tests +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.models.ftp_server_instant_test_request import FtpServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.ftp_server_instant_test_response import FtpServerInstantTestResponse +from thousandeyes_sdk.instant_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.instant_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.instant_tests.FTPServerInstantTestsApi(api_client) + ftp_server_instant_test_request = thousandeyes_sdk.instant_tests.FtpServerInstantTestRequest() # FtpServerInstantTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.instant_tests.ExpandInstantTestOptions()] # List[ExpandInstantTestOptions] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create FTP server instant test + api_response = api_instance.create_ftp_server_instant_test(ftp_server_instant_test_request, aid=aid, expand=expand) + print("The response of FTPServerInstantTestsApi->create_ftp_server_instant_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FTPServerInstantTestsApi->create_ftp_server_instant_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ftp_server_instant_test_request** | [**FtpServerInstantTestRequest**](FtpServerInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandInstantTestOptions]**](ExpandInstantTestOptions.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**FtpServerInstantTestResponse**](FtpServerInstantTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-instant-tests/docs/FtpServerInstantTest.md b/thousandeyes-sdk-instant-tests/docs/FtpServerInstantTest.md index 1a57ab353..0d6c0ec99 100644 --- a/thousandeyes-sdk-instant-tests/docs/FtpServerInstantTest.md +++ b/thousandeyes-sdk-instant-tests/docs/FtpServerInstantTest.md @@ -36,7 +36,6 @@ Name | Type | Description | Notes **username** | **str** | Username for Basic/NTLM authentication. | **fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] **ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-instant-tests/docs/FtpServerInstantTestRequest.md b/thousandeyes-sdk-instant-tests/docs/FtpServerInstantTestRequest.md new file mode 100644 index 000000000..ff737b614 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/FtpServerInstantTestRequest.md @@ -0,0 +1,60 @@ +# FtpServerInstantTestRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | **List[str]** | A list of test label identifiers (get `labelId` from `/labels` endpoint). | [optional] +**shared_with_accounts** | **List[str]** | A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint). | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**download_limit** | **int** | Specify maximum number of bytes to download from the target object. | [optional] +**ftp_target_time** | **int** | Target time for operation completion; specified in milliseconds. | [optional] +**ftp_time_limit** | **int** | Set the time limit for the test in seconds. | [optional] [default to 10] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**request_type** | [**FtpServerRequestType**](FtpServerRequestType.md) | | +**url** | **str** | Target for the test. | +**use_active_ftp** | **bool** | Explicitly set the flag to use active FTP. | [optional] [default to False] +**use_explicit_ftps** | **bool** | Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**agents** | [**List[TestAgent]**](TestAgent.md) | A list of objects with `agentId` (required) and `sourceIpAddress` (optional). | + +## Example + +```python +from thousandeyes_sdk.instant_tests.models.ftp_server_instant_test_request import FtpServerInstantTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of FtpServerInstantTestRequest from a JSON string +ftp_server_instant_test_request_instance = FtpServerInstantTestRequest.from_json(json) +# print the JSON string representation of the object +print(FtpServerInstantTestRequest.to_json()) + +# convert the object into a dict +ftp_server_instant_test_request_dict = ftp_server_instant_test_request_instance.to_dict() +# create an instance of FtpServerInstantTestRequest from a dict +ftp_server_instant_test_request_from_dict = FtpServerInstantTestRequest.from_dict(ftp_server_instant_test_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-instant-tests/docs/FtpServerInstantTestResponse.md b/thousandeyes-sdk-instant-tests/docs/FtpServerInstantTestResponse.md new file mode 100644 index 000000000..4c30143f0 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/FtpServerInstantTestResponse.md @@ -0,0 +1,60 @@ +# FtpServerInstantTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**download_limit** | **int** | Specify maximum number of bytes to download from the target object. | [optional] +**ftp_target_time** | **int** | Target time for operation completion; specified in milliseconds. | [optional] +**ftp_time_limit** | **int** | Set the time limit for the test in seconds. | [optional] [default to 10] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**request_type** | [**FtpServerRequestType**](FtpServerRequestType.md) | | +**url** | **str** | Target for the test. | +**use_active_ftp** | **bool** | Explicitly set the flag to use active FTP. | [optional] [default to False] +**use_explicit_ftps** | **bool** | Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.instant_tests.models.ftp_server_instant_test_response import FtpServerInstantTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FtpServerInstantTestResponse from a JSON string +ftp_server_instant_test_response_instance = FtpServerInstantTestResponse.from_json(json) +# print the JSON string representation of the object +print(FtpServerInstantTestResponse.to_json()) + +# convert the object into a dict +ftp_server_instant_test_response_dict = ftp_server_instant_test_response_instance.to_dict() +# create an instance of FtpServerInstantTestResponse from a dict +ftp_server_instant_test_response_from_dict = FtpServerInstantTestResponse.from_dict(ftp_server_instant_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-instant-tests/docs/HTTPPageLoadInstantTestsApi.md b/thousandeyes-sdk-instant-tests/docs/HTTPPageLoadInstantTestsApi.md new file mode 100644 index 000000000..869413c33 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/HTTPPageLoadInstantTestsApi.md @@ -0,0 +1,101 @@ +# thousandeyes_sdk.instant_tests.HTTPPageLoadInstantTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_page_load_instant_test**](HTTPPageLoadInstantTestsApi.md#create_page_load_instant_test) | **POST** /tests/page-load/instant | Create HTTP page load instant test + + +# **create_page_load_instant_test** +> PageLoadInstantTestResponse create_page_load_instant_test(page_load_instant_test_request, aid=aid, expand=expand) + +Create HTTP page load instant test + +Creates and runs a new HTTP page load instant test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.instant_tests +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.models.page_load_instant_test_request import PageLoadInstantTestRequest +from thousandeyes_sdk.instant_tests.models.page_load_instant_test_response import PageLoadInstantTestResponse +from thousandeyes_sdk.instant_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.instant_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.instant_tests.HTTPPageLoadInstantTestsApi(api_client) + page_load_instant_test_request = thousandeyes_sdk.instant_tests.PageLoadInstantTestRequest() # PageLoadInstantTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.instant_tests.ExpandInstantTestOptions()] # List[ExpandInstantTestOptions] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create HTTP page load instant test + api_response = api_instance.create_page_load_instant_test(page_load_instant_test_request, aid=aid, expand=expand) + print("The response of HTTPPageLoadInstantTestsApi->create_page_load_instant_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPPageLoadInstantTestsApi->create_page_load_instant_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page_load_instant_test_request** | [**PageLoadInstantTestRequest**](PageLoadInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandInstantTestOptions]**](ExpandInstantTestOptions.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**PageLoadInstantTestResponse**](PageLoadInstantTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-instant-tests/docs/HTTPServerInstantTestsApi.md b/thousandeyes-sdk-instant-tests/docs/HTTPServerInstantTestsApi.md new file mode 100644 index 000000000..383b95e68 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/HTTPServerInstantTestsApi.md @@ -0,0 +1,101 @@ +# thousandeyes_sdk.instant_tests.HTTPServerInstantTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_http_server_instant_test**](HTTPServerInstantTestsApi.md#create_http_server_instant_test) | **POST** /tests/http-server/instant | Create HTTP server instant test + + +# **create_http_server_instant_test** +> HttpServerInstantTestResponse create_http_server_instant_test(http_server_instant_test_request, aid=aid, expand=expand) + +Create HTTP server instant test + +Creates and runs a new HTTP server instant test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.instant_tests +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.models.http_server_instant_test_request import HttpServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.http_server_instant_test_response import HttpServerInstantTestResponse +from thousandeyes_sdk.instant_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.instant_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.instant_tests.HTTPServerInstantTestsApi(api_client) + http_server_instant_test_request = thousandeyes_sdk.instant_tests.HttpServerInstantTestRequest() # HttpServerInstantTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.instant_tests.ExpandInstantTestOptions()] # List[ExpandInstantTestOptions] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create HTTP server instant test + api_response = api_instance.create_http_server_instant_test(http_server_instant_test_request, aid=aid, expand=expand) + print("The response of HTTPServerInstantTestsApi->create_http_server_instant_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPServerInstantTestsApi->create_http_server_instant_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **http_server_instant_test_request** | [**HttpServerInstantTestRequest**](HttpServerInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandInstantTestOptions]**](ExpandInstantTestOptions.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**HttpServerInstantTestResponse**](HttpServerInstantTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-instant-tests/docs/HttpServerBaseProperties.md b/thousandeyes-sdk-instant-tests/docs/HttpServerBaseProperties.md index c0ab9c25a..154dbce91 100644 --- a/thousandeyes-sdk-instant-tests/docs/HttpServerBaseProperties.md +++ b/thousandeyes-sdk-instant-tests/docs/HttpServerBaseProperties.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] diff --git a/thousandeyes-sdk-instant-tests/docs/HttpServerInstantTest.md b/thousandeyes-sdk-instant-tests/docs/HttpServerInstantTest.md index 59162d1a4..420914448 100644 --- a/thousandeyes-sdk-instant-tests/docs/HttpServerInstantTest.md +++ b/thousandeyes-sdk-instant-tests/docs/HttpServerInstantTest.md @@ -24,7 +24,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] @@ -55,7 +55,6 @@ Name | Type | Description | Notes **headers** | **List[str]** | HTTP request headers used. | [optional] **post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] **ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-instant-tests/docs/HttpServerInstantTestRequest.md b/thousandeyes-sdk-instant-tests/docs/HttpServerInstantTestRequest.md index ad13a52f9..fe83915f9 100644 --- a/thousandeyes-sdk-instant-tests/docs/HttpServerInstantTestRequest.md +++ b/thousandeyes-sdk-instant-tests/docs/HttpServerInstantTestRequest.md @@ -24,7 +24,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] diff --git a/thousandeyes-sdk-instant-tests/docs/HttpServerInstantTestResponse.md b/thousandeyes-sdk-instant-tests/docs/HttpServerInstantTestResponse.md new file mode 100644 index 000000000..8fa62fd06 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/HttpServerInstantTestResponse.md @@ -0,0 +1,79 @@ +# HttpServerInstantTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**agent_interfaces** | [**AgentInterfaces**](AgentInterfaces.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] +**download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] +**dns_override** | **str** | IP address to use for DNS override. | [optional] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**o_auth** | [**OAuth**](OAuth.md) | | [optional] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**allow_unsafe_legacy_renegotiation** | **bool** | Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation. | [optional] [default to True] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] +**headers** | **List[str]** | HTTP request headers used. | [optional] +**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.instant_tests.models.http_server_instant_test_response import HttpServerInstantTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpServerInstantTestResponse from a JSON string +http_server_instant_test_response_instance = HttpServerInstantTestResponse.from_json(json) +# print the JSON string representation of the object +print(HttpServerInstantTestResponse.to_json()) + +# convert the object into a dict +http_server_instant_test_response_dict = http_server_instant_test_response_instance.to_dict() +# create an instance of HttpServerInstantTestResponse from a dict +http_server_instant_test_response_from_dict = HttpServerInstantTestResponse.from_dict(http_server_instant_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-instant-tests/docs/HttpServerProperties.md b/thousandeyes-sdk-instant-tests/docs/HttpServerProperties.md index e51b9357f..17874609d 100644 --- a/thousandeyes-sdk-instant-tests/docs/HttpServerProperties.md +++ b/thousandeyes-sdk-instant-tests/docs/HttpServerProperties.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] diff --git a/thousandeyes-sdk-instant-tests/docs/InstantTestsApi.md b/thousandeyes-sdk-instant-tests/docs/InstantTestsApi.md new file mode 100644 index 000000000..ab577d6d3 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/InstantTestsApi.md @@ -0,0 +1,93 @@ +# thousandeyes_sdk.instant_tests.InstantTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**run_instant_test**](InstantTestsApi.md#run_instant_test) | **POST** /tests/{testId}/run | Run instant test + + +# **run_instant_test** +> run_instant_test(test_id, aid=aid) + +Run instant test + +Run an existing instant test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.instant_tests +from thousandeyes_sdk.instant_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.instant_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.instant_tests.InstantTestsApi(api_client) + test_id = '105' # str | Identifier for the instant test you wish to rerun. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Run instant test + api_instance.run_instant_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling InstantTestsApi->run_instant_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Identifier for the instant test you wish to rerun. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-instant-tests/docs/PageLoadInstantTest.md b/thousandeyes-sdk-instant-tests/docs/PageLoadInstantTest.md index 5180cd504..5eaca3c33 100644 --- a/thousandeyes-sdk-instant-tests/docs/PageLoadInstantTest.md +++ b/thousandeyes-sdk-instant-tests/docs/PageLoadInstantTest.md @@ -24,7 +24,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] @@ -61,7 +61,6 @@ Name | Type | Description | Notes **allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] **browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] **page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-instant-tests/docs/PageLoadInstantTestRequest.md b/thousandeyes-sdk-instant-tests/docs/PageLoadInstantTestRequest.md index 1003fa2bd..63024b140 100644 --- a/thousandeyes-sdk-instant-tests/docs/PageLoadInstantTestRequest.md +++ b/thousandeyes-sdk-instant-tests/docs/PageLoadInstantTestRequest.md @@ -24,7 +24,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] diff --git a/thousandeyes-sdk-instant-tests/docs/PageLoadInstantTestResponse.md b/thousandeyes-sdk-instant-tests/docs/PageLoadInstantTestResponse.md new file mode 100644 index 000000000..aaa9fd5b0 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/PageLoadInstantTestResponse.md @@ -0,0 +1,85 @@ +# PageLoadInstantTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**agent_interfaces** | [**AgentInterfaces**](AgentInterfaces.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] +**download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] +**dns_override** | **str** | IP address to use for DNS override. | [optional] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**o_auth** | [**OAuth**](OAuth.md) | | [optional] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**allow_unsafe_legacy_renegotiation** | **bool** | Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation. | [optional] [default to True] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] +**emulated_device_id** | **str** | ID of the emulated device, if one was given when the test was created. | [optional] +**page_load_target_time** | **int** | Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`. | [optional] +**page_load_time_limit** | **int** | Page load time limit. Must be larger than the `httpTimeLimit`. | [optional] [default to 10] +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.instant_tests.models.page_load_instant_test_response import PageLoadInstantTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of PageLoadInstantTestResponse from a JSON string +page_load_instant_test_response_instance = PageLoadInstantTestResponse.from_json(json) +# print the JSON string representation of the object +print(PageLoadInstantTestResponse.to_json()) + +# convert the object into a dict +page_load_instant_test_response_dict = page_load_instant_test_response_instance.to_dict() +# create an instance of PageLoadInstantTestResponse from a dict +page_load_instant_test_response_from_dict = PageLoadInstantTestResponse.from_dict(page_load_instant_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-instant-tests/docs/PageLoadProperties.md b/thousandeyes-sdk-instant-tests/docs/PageLoadProperties.md index fb9df8962..004d43c73 100644 --- a/thousandeyes-sdk-instant-tests/docs/PageLoadProperties.md +++ b/thousandeyes-sdk-instant-tests/docs/PageLoadProperties.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] diff --git a/thousandeyes-sdk-instant-tests/docs/SIPServerInstantTestsApi.md b/thousandeyes-sdk-instant-tests/docs/SIPServerInstantTestsApi.md new file mode 100644 index 000000000..2eb216eee --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/SIPServerInstantTestsApi.md @@ -0,0 +1,101 @@ +# thousandeyes_sdk.instant_tests.SIPServerInstantTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_sip_server_instant_test**](SIPServerInstantTestsApi.md#create_sip_server_instant_test) | **POST** /tests/sip-server/instant | Create SIP server instant test + + +# **create_sip_server_instant_test** +> SipServerInstantTestResponse create_sip_server_instant_test(sip_server_instant_test_request, aid=aid, expand=expand) + +Create SIP server instant test + +Creates and runs a new SIP server instant test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.instant_tests +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.models.sip_server_instant_test_request import SipServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.sip_server_instant_test_response import SipServerInstantTestResponse +from thousandeyes_sdk.instant_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.instant_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.instant_tests.SIPServerInstantTestsApi(api_client) + sip_server_instant_test_request = thousandeyes_sdk.instant_tests.SipServerInstantTestRequest() # SipServerInstantTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.instant_tests.ExpandInstantTestOptions()] # List[ExpandInstantTestOptions] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create SIP server instant test + api_response = api_instance.create_sip_server_instant_test(sip_server_instant_test_request, aid=aid, expand=expand) + print("The response of SIPServerInstantTestsApi->create_sip_server_instant_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SIPServerInstantTestsApi->create_sip_server_instant_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sip_server_instant_test_request** | [**SipServerInstantTestRequest**](SipServerInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandInstantTestOptions]**](ExpandInstantTestOptions.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**SipServerInstantTestResponse**](SipServerInstantTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-instant-tests/docs/SipServerInstantTest.md b/thousandeyes-sdk-instant-tests/docs/SipServerInstantTest.md index ffad65ef0..209f34e6b 100644 --- a/thousandeyes-sdk-instant-tests/docs/SipServerInstantTest.md +++ b/thousandeyes-sdk-instant-tests/docs/SipServerInstantTest.md @@ -29,7 +29,6 @@ Name | Type | Description | Notes **sip_time_limit** | **int** | Time limit in milliseconds. | [optional] [default to 5] **fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] **ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-instant-tests/docs/SipServerInstantTestResponse.md b/thousandeyes-sdk-instant-tests/docs/SipServerInstantTestResponse.md index bdbbd0047..aed16bfdf 100644 --- a/thousandeyes-sdk-instant-tests/docs/SipServerInstantTestResponse.md +++ b/thousandeyes-sdk-instant-tests/docs/SipServerInstantTestResponse.md @@ -29,13 +29,13 @@ Name | Type | Description | Notes **sip_time_limit** | **int** | Time limit in milliseconds. | [optional] [default to 5] **fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] **ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] **auth_user** | **str** | Username for authentication with SIP server. | [optional] **password** | **str** | Password for Basic/NTLM authentication. | [optional] **port** | **int** | Target port. | [default to 49153] **protocol** | [**SipTestProtocol**](SipTestProtocol.md) | | [optional] **sip_registrar** | **str** | SIP server to be tested, specified by domain name or IP address. | [optional] **user** | **str** | Username for SIP registration, should be unique within a ThousandEyes account group. | [optional] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] ## Example diff --git a/thousandeyes-sdk-instant-tests/docs/VoiceInstantTest.md b/thousandeyes-sdk-instant-tests/docs/VoiceInstantTest.md index 4a015c312..ad32e0359 100644 --- a/thousandeyes-sdk-instant-tests/docs/VoiceInstantTest.md +++ b/thousandeyes-sdk-instant-tests/docs/VoiceInstantTest.md @@ -27,7 +27,6 @@ Name | Type | Description | Notes **num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] **port** | **int** | Port number for the chosen protocol. | [optional] **target_agent_id** | **str** | Agent ID of the target agent for the test. | -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-instant-tests/docs/VoiceInstantTestResponse.md b/thousandeyes-sdk-instant-tests/docs/VoiceInstantTestResponse.md new file mode 100644 index 000000000..634c7b3de --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/VoiceInstantTestResponse.md @@ -0,0 +1,51 @@ +# VoiceInstantTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**codec** | **str** | Codec label | [optional] [readonly] +**codec_id** | **str** | Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab) | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**duration** | **int** | Duration of the test in seconds. | [optional] [default to 5] +**jitter_buffer** | **int** | De-jitter buffer size in seconds. | [optional] [default to 40] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**port** | **int** | Port number for the chosen protocol. | [optional] +**target_agent_id** | **str** | Agent ID of the target agent for the test. | +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.instant_tests.models.voice_instant_test_response import VoiceInstantTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of VoiceInstantTestResponse from a JSON string +voice_instant_test_response_instance = VoiceInstantTestResponse.from_json(json) +# print the JSON string representation of the object +print(VoiceInstantTestResponse.to_json()) + +# convert the object into a dict +voice_instant_test_response_dict = voice_instant_test_response_instance.to_dict() +# create an instance of VoiceInstantTestResponse from a dict +voice_instant_test_response_from_dict = VoiceInstantTestResponse.from_dict(voice_instant_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-instant-tests/docs/VoiceInstantTestsApi.md b/thousandeyes-sdk-instant-tests/docs/VoiceInstantTestsApi.md new file mode 100644 index 000000000..ab49cf298 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/VoiceInstantTestsApi.md @@ -0,0 +1,101 @@ +# thousandeyes_sdk.instant_tests.VoiceInstantTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_voice_instant_test**](VoiceInstantTestsApi.md#create_voice_instant_test) | **POST** /tests/voice/instant | Create voice instant test + + +# **create_voice_instant_test** +> VoiceInstantTestResponse create_voice_instant_test(voice_instant_test_request, aid=aid, expand=expand) + +Create voice instant test + +Creates and runs a voice instant test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.instant_tests +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.models.voice_instant_test_request import VoiceInstantTestRequest +from thousandeyes_sdk.instant_tests.models.voice_instant_test_response import VoiceInstantTestResponse +from thousandeyes_sdk.instant_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.instant_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.instant_tests.VoiceInstantTestsApi(api_client) + voice_instant_test_request = thousandeyes_sdk.instant_tests.VoiceInstantTestRequest() # VoiceInstantTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.instant_tests.ExpandInstantTestOptions()] # List[ExpandInstantTestOptions] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create voice instant test + api_response = api_instance.create_voice_instant_test(voice_instant_test_request, aid=aid, expand=expand) + print("The response of VoiceInstantTestsApi->create_voice_instant_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VoiceInstantTestsApi->create_voice_instant_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **voice_instant_test_request** | [**VoiceInstantTestRequest**](VoiceInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandInstantTestOptions]**](ExpandInstantTestOptions.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**VoiceInstantTestResponse**](VoiceInstantTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTest.md b/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTest.md index 7d85b3fb4..cab196e53 100644 --- a/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTest.md +++ b/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTest.md @@ -24,7 +24,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] @@ -62,7 +62,6 @@ Name | Type | Description | Notes **allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] **browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] **page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] **credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] ## Example diff --git a/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTestRequest.md b/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTestRequest.md index 623888cd8..cf7587049 100644 --- a/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTestRequest.md +++ b/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTestRequest.md @@ -24,7 +24,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] @@ -62,8 +62,8 @@ Name | Type | Description | Notes **allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] **browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] **page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] -**agents** | [**List[TestAgent]**](TestAgent.md) | A list of objects with `agentId` (required) and `sourceIpAddress` (optional). | **credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] +**agents** | [**List[TestAgent]**](TestAgent.md) | A list of objects with `agentId` (required) and `sourceIpAddress` (optional). | ## Example diff --git a/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTestResponse.md b/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTestResponse.md new file mode 100644 index 000000000..c27d7bb67 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTestResponse.md @@ -0,0 +1,87 @@ +# WebTransactionInstantTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**agent_interfaces** | [**AgentInterfaces**](AgentInterfaces.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] +**download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] +**dns_override** | **str** | IP address to use for DNS override. | [optional] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**o_auth** | [**OAuth**](OAuth.md) | | [optional] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**allow_unsafe_legacy_renegotiation** | **bool** | Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation. | [optional] [default to True] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] +**emulated_device_id** | **str** | ID of the emulated device, if specified when the test was created. | [optional] +**target_time** | **int** | Target completion time. The default is 50% of the specified time limit in seconds. (Set to 0 to use the default behavior). | [optional] +**time_limit** | **int** | Time limit for transaction in seconds. | [optional] [default to 30] +**transaction_script** | **str** | JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ). | +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.instant_tests.models.web_transaction_instant_test_response import WebTransactionInstantTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of WebTransactionInstantTestResponse from a JSON string +web_transaction_instant_test_response_instance = WebTransactionInstantTestResponse.from_json(json) +# print the JSON string representation of the object +print(WebTransactionInstantTestResponse.to_json()) + +# convert the object into a dict +web_transaction_instant_test_response_dict = web_transaction_instant_test_response_instance.to_dict() +# create an instance of WebTransactionInstantTestResponse from a dict +web_transaction_instant_test_response_from_dict = WebTransactionInstantTestResponse.from_dict(web_transaction_instant_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTestsApi.md b/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTestsApi.md new file mode 100644 index 000000000..0b8271fa3 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/docs/WebTransactionInstantTestsApi.md @@ -0,0 +1,101 @@ +# thousandeyes_sdk.instant_tests.WebTransactionInstantTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_web_transaction_instant_test**](WebTransactionInstantTestsApi.md#create_web_transaction_instant_test) | **POST** /tests/web-transactions/instant | Create web transactions instant test + + +# **create_web_transaction_instant_test** +> WebTransactionInstantTestResponse create_web_transaction_instant_test(web_transaction_instant_test_request, aid=aid, expand=expand) + +Create web transactions instant test + +Creates and runs a new Web transactions instant test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.instant_tests +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.models.web_transaction_instant_test_request import WebTransactionInstantTestRequest +from thousandeyes_sdk.instant_tests.models.web_transaction_instant_test_response import WebTransactionInstantTestResponse +from thousandeyes_sdk.instant_tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.instant_tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.instant_tests.WebTransactionInstantTestsApi(api_client) + web_transaction_instant_test_request = thousandeyes_sdk.instant_tests.WebTransactionInstantTestRequest() # WebTransactionInstantTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.instant_tests.ExpandInstantTestOptions()] # List[ExpandInstantTestOptions] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional) + + try: + # Create web transactions instant test + api_response = api_instance.create_web_transaction_instant_test(web_transaction_instant_test_request, aid=aid, expand=expand) + print("The response of WebTransactionInstantTestsApi->create_web_transaction_instant_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebTransactionInstantTestsApi->create_web_transaction_instant_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **web_transaction_instant_test_request** | [**WebTransactionInstantTestRequest**](WebTransactionInstantTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandInstantTestOptions]**](ExpandInstantTestOptions.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional] + +### Return type + +[**WebTransactionInstantTestResponse**](WebTransactionInstantTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-instant-tests/docs/WebTransactionProperties.md b/thousandeyes-sdk-instant-tests/docs/WebTransactionProperties.md index ffc67e253..ac3cbb065 100644 --- a/thousandeyes-sdk-instant-tests/docs/WebTransactionProperties.md +++ b/thousandeyes-sdk-instant-tests/docs/WebTransactionProperties.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/__init__.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/__init__.py index ae95a0918..6c8922b57 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/__init__.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/__init__.py @@ -14,34 +14,37 @@ # import apis into sdk package -from thousandeyes_sdk.instant_tests.api.api_api import APIApi -from thousandeyes_sdk.instant_tests.api.agent_to_agent_api import AgentToAgentApi -from thousandeyes_sdk.instant_tests.api.agent_to_server_api import AgentToServerApi -from thousandeyes_sdk.instant_tests.api.dns_security_api import DNSSecurityApi -from thousandeyes_sdk.instant_tests.api.dns_server_api import DNSServerApi -from thousandeyes_sdk.instant_tests.api.dns_trace_api import DNSTraceApi -from thousandeyes_sdk.instant_tests.api.ftp_server_api import FTPServerApi -from thousandeyes_sdk.instant_tests.api.http_page_load_api import HTTPPageLoadApi -from thousandeyes_sdk.instant_tests.api.http_server_api import HTTPServerApi -from thousandeyes_sdk.instant_tests.api.run_api import RunApi -from thousandeyes_sdk.instant_tests.api.sip_server_api import SIPServerApi -from thousandeyes_sdk.instant_tests.api.voice_api import VoiceApi -from thousandeyes_sdk.instant_tests.api.web_transaction_api import WebTransactionApi +from thousandeyes_sdk.instant_tests.api.api_instant_tests_api import APIInstantTestsApi +from thousandeyes_sdk.instant_tests.api.agent_to_agent_instant_tests_api import AgentToAgentInstantTestsApi +from thousandeyes_sdk.instant_tests.api.agent_to_server_instant_tests_api import AgentToServerInstantTestsApi +from thousandeyes_sdk.instant_tests.api.dnssec_instant_tests_api import DNSSECInstantTestsApi +from thousandeyes_sdk.instant_tests.api.dns_server_instant_tests_api import DNSServerInstantTestsApi +from thousandeyes_sdk.instant_tests.api.dns_trace_instant_tests_api import DNSTraceInstantTestsApi +from thousandeyes_sdk.instant_tests.api.ftp_server_instant_tests_api import FTPServerInstantTestsApi +from thousandeyes_sdk.instant_tests.api.http_page_load_instant_tests_api import HTTPPageLoadInstantTestsApi +from thousandeyes_sdk.instant_tests.api.http_server_instant_tests_api import HTTPServerInstantTestsApi +from thousandeyes_sdk.instant_tests.api.instant_tests_api import InstantTestsApi +from thousandeyes_sdk.instant_tests.api.sip_server_instant_tests_api import SIPServerInstantTestsApi +from thousandeyes_sdk.instant_tests.api.voice_instant_tests_api import VoiceInstantTestsApi +from thousandeyes_sdk.instant_tests.api.web_transaction_instant_tests_api import WebTransactionInstantTestsApi # import models into sdk package -from thousandeyes_sdk.instant_tests.models.agent import Agent from thousandeyes_sdk.instant_tests.models.agent_base import AgentBase from thousandeyes_sdk.instant_tests.models.agent_interfaces import AgentInterfaces +from thousandeyes_sdk.instant_tests.models.agent_response import AgentResponse from thousandeyes_sdk.instant_tests.models.agent_to_agent_instant_test import AgentToAgentInstantTest from thousandeyes_sdk.instant_tests.models.agent_to_agent_instant_test_request import AgentToAgentInstantTestRequest +from thousandeyes_sdk.instant_tests.models.agent_to_agent_instant_test_response import AgentToAgentInstantTestResponse from thousandeyes_sdk.instant_tests.models.agent_to_agent_properties import AgentToAgentProperties from thousandeyes_sdk.instant_tests.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol from thousandeyes_sdk.instant_tests.models.agent_to_server_instant_test import AgentToServerInstantTest from thousandeyes_sdk.instant_tests.models.agent_to_server_instant_test_request import AgentToServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.agent_to_server_instant_test_response import AgentToServerInstantTestResponse from thousandeyes_sdk.instant_tests.models.agent_to_server_properties import AgentToServerProperties from thousandeyes_sdk.instant_tests.models.api_instant_test import ApiInstantTest from thousandeyes_sdk.instant_tests.models.api_instant_test_request import ApiInstantTestRequest +from thousandeyes_sdk.instant_tests.models.api_instant_test_response import ApiInstantTestResponse from thousandeyes_sdk.instant_tests.models.api_predefined_variable import ApiPredefinedVariable from thousandeyes_sdk.instant_tests.models.api_properties import ApiProperties from thousandeyes_sdk.instant_tests.models.api_request import ApiRequest @@ -56,22 +59,28 @@ from thousandeyes_sdk.instant_tests.models.dns_query_class import DnsQueryClass from thousandeyes_sdk.instant_tests.models.dns_sec_instant_test import DnsSecInstantTest from thousandeyes_sdk.instant_tests.models.dns_sec_instant_test_request import DnsSecInstantTestRequest +from thousandeyes_sdk.instant_tests.models.dns_sec_instant_test_response import DnsSecInstantTestResponse from thousandeyes_sdk.instant_tests.models.dns_sec_properties import DnsSecProperties from thousandeyes_sdk.instant_tests.models.dns_server_instant_test import DnsServerInstantTest from thousandeyes_sdk.instant_tests.models.dns_server_instant_test_request import DnsServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.dns_server_instant_test_response import DnsServerInstantTestResponse from thousandeyes_sdk.instant_tests.models.dns_server_properties import DnsServerProperties from thousandeyes_sdk.instant_tests.models.dns_servers_request import DnsServersRequest from thousandeyes_sdk.instant_tests.models.dns_trace_instant_test import DnsTraceInstantTest from thousandeyes_sdk.instant_tests.models.dns_trace_instant_test_request import DnsTraceInstantTestRequest +from thousandeyes_sdk.instant_tests.models.dns_trace_instant_test_response import DnsTraceInstantTestResponse from thousandeyes_sdk.instant_tests.models.dns_trace_properties import DnsTraceProperties from thousandeyes_sdk.instant_tests.models.error import Error -from thousandeyes_sdk.instant_tests.models.expand import Expand +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions from thousandeyes_sdk.instant_tests.models.ftp_server_instant_test import FtpServerInstantTest +from thousandeyes_sdk.instant_tests.models.ftp_server_instant_test_request import FtpServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.ftp_server_instant_test_response import FtpServerInstantTestResponse from thousandeyes_sdk.instant_tests.models.ftp_server_properties import FtpServerProperties from thousandeyes_sdk.instant_tests.models.ftp_server_request_type import FtpServerRequestType from thousandeyes_sdk.instant_tests.models.http_server_base_properties import HttpServerBaseProperties from thousandeyes_sdk.instant_tests.models.http_server_instant_test import HttpServerInstantTest from thousandeyes_sdk.instant_tests.models.http_server_instant_test_request import HttpServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.http_server_instant_test_response import HttpServerInstantTestResponse from thousandeyes_sdk.instant_tests.models.http_server_properties import HttpServerProperties from thousandeyes_sdk.instant_tests.models.instant_test import InstantTest from thousandeyes_sdk.instant_tests.models.instant_test_request import InstantTestRequest @@ -79,14 +88,13 @@ from thousandeyes_sdk.instant_tests.models.o_auth import OAuth from thousandeyes_sdk.instant_tests.models.page_load_instant_test import PageLoadInstantTest from thousandeyes_sdk.instant_tests.models.page_load_instant_test_request import PageLoadInstantTestRequest +from thousandeyes_sdk.instant_tests.models.page_load_instant_test_response import PageLoadInstantTestResponse from thousandeyes_sdk.instant_tests.models.page_load_properties import PageLoadProperties from thousandeyes_sdk.instant_tests.models.request_method import RequestMethod -from thousandeyes_sdk.instant_tests.models.server_instant_test_request import ServerInstantTestRequest from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.instant_tests.models.simple_agent import SimpleAgent from thousandeyes_sdk.instant_tests.models.sip_server_instant_test import SipServerInstantTest from thousandeyes_sdk.instant_tests.models.sip_server_instant_test_request import SipServerInstantTestRequest -from thousandeyes_sdk.instant_tests.models.sip_server_instant_test_request1 import SipServerInstantTestRequest1 from thousandeyes_sdk.instant_tests.models.sip_server_instant_test_response import SipServerInstantTestResponse from thousandeyes_sdk.instant_tests.models.sip_server_properties import SipServerProperties from thousandeyes_sdk.instant_tests.models.sip_test_protocol import SipTestProtocol @@ -114,7 +122,9 @@ from thousandeyes_sdk.instant_tests.models.validation_error_item import ValidationErrorItem from thousandeyes_sdk.instant_tests.models.voice_instant_test import VoiceInstantTest from thousandeyes_sdk.instant_tests.models.voice_instant_test_request import VoiceInstantTestRequest +from thousandeyes_sdk.instant_tests.models.voice_instant_test_response import VoiceInstantTestResponse from thousandeyes_sdk.instant_tests.models.voice_properties import VoiceProperties from thousandeyes_sdk.instant_tests.models.web_transaction_instant_test import WebTransactionInstantTest from thousandeyes_sdk.instant_tests.models.web_transaction_instant_test_request import WebTransactionInstantTestRequest +from thousandeyes_sdk.instant_tests.models.web_transaction_instant_test_response import WebTransactionInstantTestResponse from thousandeyes_sdk.instant_tests.models.web_transaction_properties import WebTransactionProperties diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/__init__.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/__init__.py index fb65714a1..b1565348f 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/__init__.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/__init__.py @@ -1,17 +1,17 @@ # flake8: noqa # import apis into api package -from thousandeyes_sdk.instant_tests.api.api_api import APIApi -from thousandeyes_sdk.instant_tests.api.agent_to_agent_api import AgentToAgentApi -from thousandeyes_sdk.instant_tests.api.agent_to_server_api import AgentToServerApi -from thousandeyes_sdk.instant_tests.api.dns_security_api import DNSSecurityApi -from thousandeyes_sdk.instant_tests.api.dns_server_api import DNSServerApi -from thousandeyes_sdk.instant_tests.api.dns_trace_api import DNSTraceApi -from thousandeyes_sdk.instant_tests.api.ftp_server_api import FTPServerApi -from thousandeyes_sdk.instant_tests.api.http_page_load_api import HTTPPageLoadApi -from thousandeyes_sdk.instant_tests.api.http_server_api import HTTPServerApi -from thousandeyes_sdk.instant_tests.api.run_api import RunApi -from thousandeyes_sdk.instant_tests.api.sip_server_api import SIPServerApi -from thousandeyes_sdk.instant_tests.api.voice_api import VoiceApi -from thousandeyes_sdk.instant_tests.api.web_transaction_api import WebTransactionApi +from thousandeyes_sdk.instant_tests.api.api_instant_tests_api import APIInstantTestsApi +from thousandeyes_sdk.instant_tests.api.agent_to_agent_instant_tests_api import AgentToAgentInstantTestsApi +from thousandeyes_sdk.instant_tests.api.agent_to_server_instant_tests_api import AgentToServerInstantTestsApi +from thousandeyes_sdk.instant_tests.api.dnssec_instant_tests_api import DNSSECInstantTestsApi +from thousandeyes_sdk.instant_tests.api.dns_server_instant_tests_api import DNSServerInstantTestsApi +from thousandeyes_sdk.instant_tests.api.dns_trace_instant_tests_api import DNSTraceInstantTestsApi +from thousandeyes_sdk.instant_tests.api.ftp_server_instant_tests_api import FTPServerInstantTestsApi +from thousandeyes_sdk.instant_tests.api.http_page_load_instant_tests_api import HTTPPageLoadInstantTestsApi +from thousandeyes_sdk.instant_tests.api.http_server_instant_tests_api import HTTPServerInstantTestsApi +from thousandeyes_sdk.instant_tests.api.instant_tests_api import InstantTestsApi +from thousandeyes_sdk.instant_tests.api.sip_server_instant_tests_api import SIPServerInstantTestsApi +from thousandeyes_sdk.instant_tests.api.voice_instant_tests_api import VoiceInstantTestsApi +from thousandeyes_sdk.instant_tests.api.web_transaction_instant_tests_api import WebTransactionInstantTestsApi diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/agent_to_agent_instant_tests_api.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/agent_to_agent_instant_tests_api.py new file mode 100644 index 000000000..b0b68b68e --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/agent_to_agent_instant_tests_api.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.instant_tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.agent_to_agent_instant_test_request import AgentToAgentInstantTestRequest +from thousandeyes_sdk.instant_tests.models.agent_to_agent_instant_test_response import AgentToAgentInstantTestResponse +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class AgentToAgentInstantTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-instant-tests")) + self.api_client = api_client + + + @validate_call + def create_agent_to_agent_instant_test( + self, + agent_to_agent_instant_test_request: AgentToAgentInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AgentToAgentInstantTestResponse: + """Create agent-to-agent instant test + + Creates and runs a new agent-to-agent instant test. + + :param agent_to_agent_instant_test_request: (required) + :type agent_to_agent_instant_test_request: AgentToAgentInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_agent_instant_test_serialize( + agent_to_agent_instant_test_request=agent_to_agent_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AgentToAgentInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ).data + + + @validate_call + def create_agent_to_agent_instant_test_with_http_info( + self, + agent_to_agent_instant_test_request: AgentToAgentInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AgentToAgentInstantTestResponse]: + """Create agent-to-agent instant test + + Creates and runs a new agent-to-agent instant test. + + :param agent_to_agent_instant_test_request: (required) + :type agent_to_agent_instant_test_request: AgentToAgentInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_agent_instant_test_serialize( + agent_to_agent_instant_test_request=agent_to_agent_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AgentToAgentInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ) + + + @validate_call + def create_agent_to_agent_instant_test_without_preload_content( + self, + agent_to_agent_instant_test_request: AgentToAgentInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create agent-to-agent instant test + + Creates and runs a new agent-to-agent instant test. + + :param agent_to_agent_instant_test_request: (required) + :type agent_to_agent_instant_test_request: AgentToAgentInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_agent_instant_test_serialize( + agent_to_agent_instant_test_request=agent_to_agent_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AgentToAgentInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_agent_to_agent_instant_test_serialize( + self, + agent_to_agent_instant_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if agent_to_agent_instant_test_request is not None: + _body_params = agent_to_agent_instant_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/agent-to-agent/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/agent_to_server_instant_tests_api.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/agent_to_server_instant_tests_api.py new file mode 100644 index 000000000..ac7be739b --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/agent_to_server_instant_tests_api.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.instant_tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.agent_to_server_instant_test_request import AgentToServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.agent_to_server_instant_test_response import AgentToServerInstantTestResponse +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class AgentToServerInstantTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-instant-tests")) + self.api_client = api_client + + + @validate_call + def create_agent_to_server_instant_test( + self, + agent_to_server_instant_test_request: AgentToServerInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AgentToServerInstantTestResponse: + """Create agent-to-server instant test + + Creates and runs a new agent-to-server instant test. + + :param agent_to_server_instant_test_request: (required) + :type agent_to_server_instant_test_request: AgentToServerInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_server_instant_test_serialize( + agent_to_server_instant_test_request=agent_to_server_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AgentToServerInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ).data + + + @validate_call + def create_agent_to_server_instant_test_with_http_info( + self, + agent_to_server_instant_test_request: AgentToServerInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AgentToServerInstantTestResponse]: + """Create agent-to-server instant test + + Creates and runs a new agent-to-server instant test. + + :param agent_to_server_instant_test_request: (required) + :type agent_to_server_instant_test_request: AgentToServerInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_server_instant_test_serialize( + agent_to_server_instant_test_request=agent_to_server_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AgentToServerInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ) + + + @validate_call + def create_agent_to_server_instant_test_without_preload_content( + self, + agent_to_server_instant_test_request: AgentToServerInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create agent-to-server instant test + + Creates and runs a new agent-to-server instant test. + + :param agent_to_server_instant_test_request: (required) + :type agent_to_server_instant_test_request: AgentToServerInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_server_instant_test_serialize( + agent_to_server_instant_test_request=agent_to_server_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AgentToServerInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_agent_to_server_instant_test_serialize( + self, + agent_to_server_instant_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if agent_to_server_instant_test_request is not None: + _body_params = agent_to_server_instant_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/agent-to-server/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/api_instant_tests_api.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/api_instant_tests_api.py new file mode 100644 index 000000000..fcca189c8 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/api_instant_tests_api.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.instant_tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.api_instant_test_request import ApiInstantTestRequest +from thousandeyes_sdk.instant_tests.models.api_instant_test_response import ApiInstantTestResponse +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class APIInstantTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-instant-tests")) + self.api_client = api_client + + + @validate_call + def create_api_instant_test( + self, + api_instant_test_request: ApiInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiInstantTestResponse: + """Create API instant test + + Creates and runs a new API instant test. + + :param api_instant_test_request: (required) + :type api_instant_test_request: ApiInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_api_instant_test_serialize( + api_instant_test_request=api_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ).data + + + @validate_call + def create_api_instant_test_with_http_info( + self, + api_instant_test_request: ApiInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ApiInstantTestResponse]: + """Create API instant test + + Creates and runs a new API instant test. + + :param api_instant_test_request: (required) + :type api_instant_test_request: ApiInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_api_instant_test_serialize( + api_instant_test_request=api_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ) + + + @validate_call + def create_api_instant_test_without_preload_content( + self, + api_instant_test_request: ApiInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create API instant test + + Creates and runs a new API instant test. + + :param api_instant_test_request: (required) + :type api_instant_test_request: ApiInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_api_instant_test_serialize( + api_instant_test_request=api_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_api_instant_test_serialize( + self, + api_instant_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if api_instant_test_request is not None: + _body_params = api_instant_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/api/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/dns_server_instant_tests_api.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/dns_server_instant_tests_api.py new file mode 100644 index 000000000..305832cb8 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/dns_server_instant_tests_api.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.instant_tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.dns_server_instant_test_request import DnsServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.dns_server_instant_test_response import DnsServerInstantTestResponse +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class DNSServerInstantTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-instant-tests")) + self.api_client = api_client + + + @validate_call + def create_dns_server_instant_test( + self, + dns_server_instant_test_request: DnsServerInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsServerInstantTestResponse: + """Create DNS server instant test + + Creates and runs a new DNS server instant test. + + :param dns_server_instant_test_request: (required) + :type dns_server_instant_test_request: DnsServerInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_server_instant_test_serialize( + dns_server_instant_test_request=dns_server_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsServerInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ).data + + + @validate_call + def create_dns_server_instant_test_with_http_info( + self, + dns_server_instant_test_request: DnsServerInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsServerInstantTestResponse]: + """Create DNS server instant test + + Creates and runs a new DNS server instant test. + + :param dns_server_instant_test_request: (required) + :type dns_server_instant_test_request: DnsServerInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_server_instant_test_serialize( + dns_server_instant_test_request=dns_server_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsServerInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ) + + + @validate_call + def create_dns_server_instant_test_without_preload_content( + self, + dns_server_instant_test_request: DnsServerInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create DNS server instant test + + Creates and runs a new DNS server instant test. + + :param dns_server_instant_test_request: (required) + :type dns_server_instant_test_request: DnsServerInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_server_instant_test_serialize( + dns_server_instant_test_request=dns_server_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsServerInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_dns_server_instant_test_serialize( + self, + dns_server_instant_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if dns_server_instant_test_request is not None: + _body_params = dns_server_instant_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/dns-server/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/dns_trace_instant_tests_api.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/dns_trace_instant_tests_api.py new file mode 100644 index 000000000..89b160e44 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/dns_trace_instant_tests_api.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.instant_tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.dns_trace_instant_test_request import DnsTraceInstantTestRequest +from thousandeyes_sdk.instant_tests.models.dns_trace_instant_test_response import DnsTraceInstantTestResponse +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class DNSTraceInstantTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-instant-tests")) + self.api_client = api_client + + + @validate_call + def create_dns_trace_instant_test( + self, + dns_trace_instant_test_request: DnsTraceInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsTraceInstantTestResponse: + """Create DNS trace instant test + + Creates and runs a new DNS trace instant test. + + :param dns_trace_instant_test_request: (required) + :type dns_trace_instant_test_request: DnsTraceInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_trace_instant_test_serialize( + dns_trace_instant_test_request=dns_trace_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsTraceInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ).data + + + @validate_call + def create_dns_trace_instant_test_with_http_info( + self, + dns_trace_instant_test_request: DnsTraceInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsTraceInstantTestResponse]: + """Create DNS trace instant test + + Creates and runs a new DNS trace instant test. + + :param dns_trace_instant_test_request: (required) + :type dns_trace_instant_test_request: DnsTraceInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_trace_instant_test_serialize( + dns_trace_instant_test_request=dns_trace_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsTraceInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ) + + + @validate_call + def create_dns_trace_instant_test_without_preload_content( + self, + dns_trace_instant_test_request: DnsTraceInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create DNS trace instant test + + Creates and runs a new DNS trace instant test. + + :param dns_trace_instant_test_request: (required) + :type dns_trace_instant_test_request: DnsTraceInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_trace_instant_test_serialize( + dns_trace_instant_test_request=dns_trace_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsTraceInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_dns_trace_instant_test_serialize( + self, + dns_trace_instant_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if dns_trace_instant_test_request is not None: + _body_params = dns_trace_instant_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/dns-trace/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/dnssec_instant_tests_api.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/dnssec_instant_tests_api.py new file mode 100644 index 000000000..a8fcd7b22 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/dnssec_instant_tests_api.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.instant_tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.dns_sec_instant_test_request import DnsSecInstantTestRequest +from thousandeyes_sdk.instant_tests.models.dns_sec_instant_test_response import DnsSecInstantTestResponse +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class DNSSECInstantTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-instant-tests")) + self.api_client = api_client + + + @validate_call + def create_dns_sec_instant_test( + self, + dns_sec_instant_test_request: DnsSecInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsSecInstantTestResponse: + """Create DNSSEC instant test + + Creates and runs a new DNSSEC instant test. + + :param dns_sec_instant_test_request: (required) + :type dns_sec_instant_test_request: DnsSecInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_sec_instant_test_serialize( + dns_sec_instant_test_request=dns_sec_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsSecInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ).data + + + @validate_call + def create_dns_sec_instant_test_with_http_info( + self, + dns_sec_instant_test_request: DnsSecInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsSecInstantTestResponse]: + """Create DNSSEC instant test + + Creates and runs a new DNSSEC instant test. + + :param dns_sec_instant_test_request: (required) + :type dns_sec_instant_test_request: DnsSecInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_sec_instant_test_serialize( + dns_sec_instant_test_request=dns_sec_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsSecInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ) + + + @validate_call + def create_dns_sec_instant_test_without_preload_content( + self, + dns_sec_instant_test_request: DnsSecInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create DNSSEC instant test + + Creates and runs a new DNSSEC instant test. + + :param dns_sec_instant_test_request: (required) + :type dns_sec_instant_test_request: DnsSecInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_sec_instant_test_serialize( + dns_sec_instant_test_request=dns_sec_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsSecInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_dns_sec_instant_test_serialize( + self, + dns_sec_instant_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if dns_sec_instant_test_request is not None: + _body_params = dns_sec_instant_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/dnssec/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/ftp_server_instant_tests_api.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/ftp_server_instant_tests_api.py new file mode 100644 index 000000000..b8eb79cfb --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/ftp_server_instant_tests_api.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.instant_tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.models.ftp_server_instant_test_request import FtpServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.ftp_server_instant_test_response import FtpServerInstantTestResponse + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class FTPServerInstantTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-instant-tests")) + self.api_client = api_client + + + @validate_call + def create_ftp_server_instant_test( + self, + ftp_server_instant_test_request: FtpServerInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FtpServerInstantTestResponse: + """Create FTP server instant test + + Creates and runs a new FTP server instant test. + + :param ftp_server_instant_test_request: (required) + :type ftp_server_instant_test_request: FtpServerInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ftp_server_instant_test_serialize( + ftp_server_instant_test_request=ftp_server_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "FtpServerInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ).data + + + @validate_call + def create_ftp_server_instant_test_with_http_info( + self, + ftp_server_instant_test_request: FtpServerInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FtpServerInstantTestResponse]: + """Create FTP server instant test + + Creates and runs a new FTP server instant test. + + :param ftp_server_instant_test_request: (required) + :type ftp_server_instant_test_request: FtpServerInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ftp_server_instant_test_serialize( + ftp_server_instant_test_request=ftp_server_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "FtpServerInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ) + + + @validate_call + def create_ftp_server_instant_test_without_preload_content( + self, + ftp_server_instant_test_request: FtpServerInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create FTP server instant test + + Creates and runs a new FTP server instant test. + + :param ftp_server_instant_test_request: (required) + :type ftp_server_instant_test_request: FtpServerInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ftp_server_instant_test_serialize( + ftp_server_instant_test_request=ftp_server_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "FtpServerInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_ftp_server_instant_test_serialize( + self, + ftp_server_instant_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if ftp_server_instant_test_request is not None: + _body_params = ftp_server_instant_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/ftp-server/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/http_page_load_instant_tests_api.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/http_page_load_instant_tests_api.py new file mode 100644 index 000000000..5b685882a --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/http_page_load_instant_tests_api.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.instant_tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.models.page_load_instant_test_request import PageLoadInstantTestRequest +from thousandeyes_sdk.instant_tests.models.page_load_instant_test_response import PageLoadInstantTestResponse + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class HTTPPageLoadInstantTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-instant-tests")) + self.api_client = api_client + + + @validate_call + def create_page_load_instant_test( + self, + page_load_instant_test_request: PageLoadInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PageLoadInstantTestResponse: + """Create HTTP page load instant test + + Creates and runs a new HTTP page load instant test. + + :param page_load_instant_test_request: (required) + :type page_load_instant_test_request: PageLoadInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_page_load_instant_test_serialize( + page_load_instant_test_request=page_load_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PageLoadInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ).data + + + @validate_call + def create_page_load_instant_test_with_http_info( + self, + page_load_instant_test_request: PageLoadInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PageLoadInstantTestResponse]: + """Create HTTP page load instant test + + Creates and runs a new HTTP page load instant test. + + :param page_load_instant_test_request: (required) + :type page_load_instant_test_request: PageLoadInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_page_load_instant_test_serialize( + page_load_instant_test_request=page_load_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PageLoadInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ) + + + @validate_call + def create_page_load_instant_test_without_preload_content( + self, + page_load_instant_test_request: PageLoadInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create HTTP page load instant test + + Creates and runs a new HTTP page load instant test. + + :param page_load_instant_test_request: (required) + :type page_load_instant_test_request: PageLoadInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_page_load_instant_test_serialize( + page_load_instant_test_request=page_load_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PageLoadInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_page_load_instant_test_serialize( + self, + page_load_instant_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if page_load_instant_test_request is not None: + _body_params = page_load_instant_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/page-load/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/http_server_instant_tests_api.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/http_server_instant_tests_api.py new file mode 100644 index 000000000..08d226d9e --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/http_server_instant_tests_api.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.instant_tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.models.http_server_instant_test_request import HttpServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.http_server_instant_test_response import HttpServerInstantTestResponse + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class HTTPServerInstantTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-instant-tests")) + self.api_client = api_client + + + @validate_call + def create_http_server_instant_test( + self, + http_server_instant_test_request: HttpServerInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HttpServerInstantTestResponse: + """Create HTTP server instant test + + Creates and runs a new HTTP server instant test. + + :param http_server_instant_test_request: (required) + :type http_server_instant_test_request: HttpServerInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_http_server_instant_test_serialize( + http_server_instant_test_request=http_server_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "HttpServerInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ).data + + + @validate_call + def create_http_server_instant_test_with_http_info( + self, + http_server_instant_test_request: HttpServerInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HttpServerInstantTestResponse]: + """Create HTTP server instant test + + Creates and runs a new HTTP server instant test. + + :param http_server_instant_test_request: (required) + :type http_server_instant_test_request: HttpServerInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_http_server_instant_test_serialize( + http_server_instant_test_request=http_server_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "HttpServerInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ) + + + @validate_call + def create_http_server_instant_test_without_preload_content( + self, + http_server_instant_test_request: HttpServerInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create HTTP server instant test + + Creates and runs a new HTTP server instant test. + + :param http_server_instant_test_request: (required) + :type http_server_instant_test_request: HttpServerInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_http_server_instant_test_serialize( + http_server_instant_test_request=http_server_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "HttpServerInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_http_server_instant_test_serialize( + self, + http_server_instant_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if http_server_instant_test_request is not None: + _body_params = http_server_instant_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/http-server/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/instant_tests_api.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/instant_tests_api.py new file mode 100644 index 000000000..0599fe035 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/instant_tests_api.py @@ -0,0 +1,337 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.instant_tests.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class InstantTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-instant-tests")) + self.api_client = api_client + + + @validate_call + def run_instant_test( + self, + test_id: Annotated[StrictStr, Field(description="Identifier for the instant test you wish to rerun.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Run instant test + + Run an existing instant test. + + :param test_id: Identifier for the instant test you wish to rerun. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._run_instant_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ).data + + + @validate_call + def run_instant_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Identifier for the instant test you wish to rerun.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Run instant test + + Run an existing instant test. + + :param test_id: Identifier for the instant test you wish to rerun. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._run_instant_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ) + + + @validate_call + def run_instant_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Identifier for the instant test you wish to rerun.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Run instant test + + Run an existing instant test. + + :param test_id: Identifier for the instant test you wish to rerun. (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._run_instant_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _run_instant_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/{testId}/run', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/sip_server_instant_tests_api.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/sip_server_instant_tests_api.py new file mode 100644 index 000000000..a9e9345a2 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/sip_server_instant_tests_api.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.instant_tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.models.sip_server_instant_test_request import SipServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.sip_server_instant_test_response import SipServerInstantTestResponse + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class SIPServerInstantTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-instant-tests")) + self.api_client = api_client + + + @validate_call + def create_sip_server_instant_test( + self, + sip_server_instant_test_request: SipServerInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SipServerInstantTestResponse: + """Create SIP server instant test + + Creates and runs a new SIP server instant test. + + :param sip_server_instant_test_request: (required) + :type sip_server_instant_test_request: SipServerInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_sip_server_instant_test_serialize( + sip_server_instant_test_request=sip_server_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SipServerInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ).data + + + @validate_call + def create_sip_server_instant_test_with_http_info( + self, + sip_server_instant_test_request: SipServerInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SipServerInstantTestResponse]: + """Create SIP server instant test + + Creates and runs a new SIP server instant test. + + :param sip_server_instant_test_request: (required) + :type sip_server_instant_test_request: SipServerInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_sip_server_instant_test_serialize( + sip_server_instant_test_request=sip_server_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SipServerInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ) + + + @validate_call + def create_sip_server_instant_test_without_preload_content( + self, + sip_server_instant_test_request: SipServerInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create SIP server instant test + + Creates and runs a new SIP server instant test. + + :param sip_server_instant_test_request: (required) + :type sip_server_instant_test_request: SipServerInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_sip_server_instant_test_serialize( + sip_server_instant_test_request=sip_server_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SipServerInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_sip_server_instant_test_serialize( + self, + sip_server_instant_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if sip_server_instant_test_request is not None: + _body_params = sip_server_instant_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/sip-server/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/voice_instant_tests_api.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/voice_instant_tests_api.py new file mode 100644 index 000000000..b7eecc6dc --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/voice_instant_tests_api.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.instant_tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.models.voice_instant_test_request import VoiceInstantTestRequest +from thousandeyes_sdk.instant_tests.models.voice_instant_test_response import VoiceInstantTestResponse + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class VoiceInstantTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-instant-tests")) + self.api_client = api_client + + + @validate_call + def create_voice_instant_test( + self, + voice_instant_test_request: VoiceInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VoiceInstantTestResponse: + """Create voice instant test + + Creates and runs a voice instant test. + + :param voice_instant_test_request: (required) + :type voice_instant_test_request: VoiceInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_voice_instant_test_serialize( + voice_instant_test_request=voice_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "VoiceInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ).data + + + @validate_call + def create_voice_instant_test_with_http_info( + self, + voice_instant_test_request: VoiceInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VoiceInstantTestResponse]: + """Create voice instant test + + Creates and runs a voice instant test. + + :param voice_instant_test_request: (required) + :type voice_instant_test_request: VoiceInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_voice_instant_test_serialize( + voice_instant_test_request=voice_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "VoiceInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ) + + + @validate_call + def create_voice_instant_test_without_preload_content( + self, + voice_instant_test_request: VoiceInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create voice instant test + + Creates and runs a voice instant test. + + :param voice_instant_test_request: (required) + :type voice_instant_test_request: VoiceInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_voice_instant_test_serialize( + voice_instant_test_request=voice_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "VoiceInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_voice_instant_test_serialize( + self, + voice_instant_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if voice_instant_test_request is not None: + _body_params = voice_instant_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/voice/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/web_transaction_instant_tests_api.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/web_transaction_instant_tests_api.py new file mode 100644 index 000000000..76d720d30 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/api/web_transaction_instant_tests_api.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.instant_tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions +from thousandeyes_sdk.instant_tests.models.web_transaction_instant_test_request import WebTransactionInstantTestRequest +from thousandeyes_sdk.instant_tests.models.web_transaction_instant_test_response import WebTransactionInstantTestResponse + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class WebTransactionInstantTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-instant-tests")) + self.api_client = api_client + + + @validate_call + def create_web_transaction_instant_test( + self, + web_transaction_instant_test_request: WebTransactionInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebTransactionInstantTestResponse: + """Create web transactions instant test + + Creates and runs a new Web transactions instant test. + + :param web_transaction_instant_test_request: (required) + :type web_transaction_instant_test_request: WebTransactionInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_web_transaction_instant_test_serialize( + web_transaction_instant_test_request=web_transaction_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebTransactionInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ).data + + + @validate_call + def create_web_transaction_instant_test_with_http_info( + self, + web_transaction_instant_test_request: WebTransactionInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebTransactionInstantTestResponse]: + """Create web transactions instant test + + Creates and runs a new Web transactions instant test. + + :param web_transaction_instant_test_request: (required) + :type web_transaction_instant_test_request: WebTransactionInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_web_transaction_instant_test_serialize( + web_transaction_instant_test_request=web_transaction_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebTransactionInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.instant_tests.models, + ) + + + @validate_call + def create_web_transaction_instant_test_without_preload_content( + self, + web_transaction_instant_test_request: WebTransactionInstantTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandInstantTestOptions]], Field(description="(Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create web transactions instant test + + Creates and runs a new Web transactions instant test. + + :param web_transaction_instant_test_request: (required) + :type web_transaction_instant_test_request: WebTransactionInstantTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. + :type expand: List[ExpandInstantTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_web_transaction_instant_test_serialize( + web_transaction_instant_test_request=web_transaction_instant_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebTransactionInstantTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_web_transaction_instant_test_serialize( + self, + web_transaction_instant_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if web_transaction_instant_test_request is not None: + _body_params = web_transaction_instant_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/web-transactions/instant', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/__init__.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/__init__.py index 23156e7b1..d2d5083d9 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/__init__.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/__init__.py @@ -13,18 +13,21 @@ # import models into model package -from thousandeyes_sdk.instant_tests.models.agent import Agent from thousandeyes_sdk.instant_tests.models.agent_base import AgentBase from thousandeyes_sdk.instant_tests.models.agent_interfaces import AgentInterfaces +from thousandeyes_sdk.instant_tests.models.agent_response import AgentResponse from thousandeyes_sdk.instant_tests.models.agent_to_agent_instant_test import AgentToAgentInstantTest from thousandeyes_sdk.instant_tests.models.agent_to_agent_instant_test_request import AgentToAgentInstantTestRequest +from thousandeyes_sdk.instant_tests.models.agent_to_agent_instant_test_response import AgentToAgentInstantTestResponse from thousandeyes_sdk.instant_tests.models.agent_to_agent_properties import AgentToAgentProperties from thousandeyes_sdk.instant_tests.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol from thousandeyes_sdk.instant_tests.models.agent_to_server_instant_test import AgentToServerInstantTest from thousandeyes_sdk.instant_tests.models.agent_to_server_instant_test_request import AgentToServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.agent_to_server_instant_test_response import AgentToServerInstantTestResponse from thousandeyes_sdk.instant_tests.models.agent_to_server_properties import AgentToServerProperties from thousandeyes_sdk.instant_tests.models.api_instant_test import ApiInstantTest from thousandeyes_sdk.instant_tests.models.api_instant_test_request import ApiInstantTestRequest +from thousandeyes_sdk.instant_tests.models.api_instant_test_response import ApiInstantTestResponse from thousandeyes_sdk.instant_tests.models.api_predefined_variable import ApiPredefinedVariable from thousandeyes_sdk.instant_tests.models.api_properties import ApiProperties from thousandeyes_sdk.instant_tests.models.api_request import ApiRequest @@ -39,22 +42,28 @@ from thousandeyes_sdk.instant_tests.models.dns_query_class import DnsQueryClass from thousandeyes_sdk.instant_tests.models.dns_sec_instant_test import DnsSecInstantTest from thousandeyes_sdk.instant_tests.models.dns_sec_instant_test_request import DnsSecInstantTestRequest +from thousandeyes_sdk.instant_tests.models.dns_sec_instant_test_response import DnsSecInstantTestResponse from thousandeyes_sdk.instant_tests.models.dns_sec_properties import DnsSecProperties from thousandeyes_sdk.instant_tests.models.dns_server_instant_test import DnsServerInstantTest from thousandeyes_sdk.instant_tests.models.dns_server_instant_test_request import DnsServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.dns_server_instant_test_response import DnsServerInstantTestResponse from thousandeyes_sdk.instant_tests.models.dns_server_properties import DnsServerProperties from thousandeyes_sdk.instant_tests.models.dns_servers_request import DnsServersRequest from thousandeyes_sdk.instant_tests.models.dns_trace_instant_test import DnsTraceInstantTest from thousandeyes_sdk.instant_tests.models.dns_trace_instant_test_request import DnsTraceInstantTestRequest +from thousandeyes_sdk.instant_tests.models.dns_trace_instant_test_response import DnsTraceInstantTestResponse from thousandeyes_sdk.instant_tests.models.dns_trace_properties import DnsTraceProperties from thousandeyes_sdk.instant_tests.models.error import Error -from thousandeyes_sdk.instant_tests.models.expand import Expand +from thousandeyes_sdk.instant_tests.models.expand_instant_test_options import ExpandInstantTestOptions from thousandeyes_sdk.instant_tests.models.ftp_server_instant_test import FtpServerInstantTest +from thousandeyes_sdk.instant_tests.models.ftp_server_instant_test_request import FtpServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.ftp_server_instant_test_response import FtpServerInstantTestResponse from thousandeyes_sdk.instant_tests.models.ftp_server_properties import FtpServerProperties from thousandeyes_sdk.instant_tests.models.ftp_server_request_type import FtpServerRequestType from thousandeyes_sdk.instant_tests.models.http_server_base_properties import HttpServerBaseProperties from thousandeyes_sdk.instant_tests.models.http_server_instant_test import HttpServerInstantTest from thousandeyes_sdk.instant_tests.models.http_server_instant_test_request import HttpServerInstantTestRequest +from thousandeyes_sdk.instant_tests.models.http_server_instant_test_response import HttpServerInstantTestResponse from thousandeyes_sdk.instant_tests.models.http_server_properties import HttpServerProperties from thousandeyes_sdk.instant_tests.models.instant_test import InstantTest from thousandeyes_sdk.instant_tests.models.instant_test_request import InstantTestRequest @@ -62,14 +71,13 @@ from thousandeyes_sdk.instant_tests.models.o_auth import OAuth from thousandeyes_sdk.instant_tests.models.page_load_instant_test import PageLoadInstantTest from thousandeyes_sdk.instant_tests.models.page_load_instant_test_request import PageLoadInstantTestRequest +from thousandeyes_sdk.instant_tests.models.page_load_instant_test_response import PageLoadInstantTestResponse from thousandeyes_sdk.instant_tests.models.page_load_properties import PageLoadProperties from thousandeyes_sdk.instant_tests.models.request_method import RequestMethod -from thousandeyes_sdk.instant_tests.models.server_instant_test_request import ServerInstantTestRequest from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.instant_tests.models.simple_agent import SimpleAgent from thousandeyes_sdk.instant_tests.models.sip_server_instant_test import SipServerInstantTest from thousandeyes_sdk.instant_tests.models.sip_server_instant_test_request import SipServerInstantTestRequest -from thousandeyes_sdk.instant_tests.models.sip_server_instant_test_request1 import SipServerInstantTestRequest1 from thousandeyes_sdk.instant_tests.models.sip_server_instant_test_response import SipServerInstantTestResponse from thousandeyes_sdk.instant_tests.models.sip_server_properties import SipServerProperties from thousandeyes_sdk.instant_tests.models.sip_test_protocol import SipTestProtocol @@ -97,7 +105,9 @@ from thousandeyes_sdk.instant_tests.models.validation_error_item import ValidationErrorItem from thousandeyes_sdk.instant_tests.models.voice_instant_test import VoiceInstantTest from thousandeyes_sdk.instant_tests.models.voice_instant_test_request import VoiceInstantTestRequest +from thousandeyes_sdk.instant_tests.models.voice_instant_test_response import VoiceInstantTestResponse from thousandeyes_sdk.instant_tests.models.voice_properties import VoiceProperties from thousandeyes_sdk.instant_tests.models.web_transaction_instant_test import WebTransactionInstantTest from thousandeyes_sdk.instant_tests.models.web_transaction_instant_test_request import WebTransactionInstantTestRequest +from thousandeyes_sdk.instant_tests.models.web_transaction_instant_test_response import WebTransactionInstantTestResponse from thousandeyes_sdk.instant_tests.models.web_transaction_properties import WebTransactionProperties diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_response.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_response.py new file mode 100644 index 000000000..091083d76 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.instant_tests.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from typing import Optional, Set +from typing_extensions import Self + +class AgentResponse(BaseModel): + """ + AgentResponse + """ # noqa: E501 + ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses") + public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses") + network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agent’s public IP.") + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the agent.", alias="agentId") + agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent.", alias="agentName") + location: Optional[StrictStr] = Field(default=None, description="Location of the agent.") + country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code", alias="countryId") + enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.") + prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.") + verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates") + agent_type: CloudEnterpriseAgentType = Field(alias="agentType") + __properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "agentType"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "ip_addresses", + "public_ip_addresses", + "network", + "agent_id", + "location", + "country_id", + "prefix", + "verify_ssl_certificates", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ipAddresses": obj.get("ipAddresses"), + "publicIpAddresses": obj.get("publicIpAddresses"), + "network": obj.get("network"), + "agentId": obj.get("agentId"), + "agentName": obj.get("agentName"), + "location": obj.get("location"), + "countryId": obj.get("countryId"), + "enabled": obj.get("enabled"), + "prefix": obj.get("prefix"), + "verifySslCertificates": obj.get("verifySslCertificates"), + "agentType": obj.get("agentType") + }) + return _obj + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test.py index 4c9f4e365..a7324b005 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.instant_tests.models.agent import Agent from thousandeyes_sdk.instant_tests.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.instant_tests.models.test_direction import TestDirection @@ -61,8 +60,7 @@ class AgentToAgentInstantTest(BaseModel): throughput_duration: Optional[Annotated[int, Field(le=30000, strict=True, ge=5000)]] = Field(default=10000, description="The throughput duration.", alias="throughputDuration") throughput_rate: Optional[Annotated[int, Field(le=1000, strict=True, ge=8)]] = Field(default=None, description="The throughput rate, only applicable for UDP protocol.", alias="throughputRate") fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate"] model_config = ConfigDict( populate_by_name=True, @@ -106,7 +104,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -120,7 +117,6 @@ def to_dict(self) -> Dict[str, Any]: "labels", "shared_with_accounts", "dscp", - "agents", ]) _dict = self.model_dump( @@ -145,13 +141,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -189,8 +178,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "throughputMeasurements": obj.get("throughputMeasurements") if obj.get("throughputMeasurements") is not None else False, "throughputDuration": obj.get("throughputDuration") if obj.get("throughputDuration") is not None else 10000, "throughputRate": obj.get("throughputRate"), - "fixedPacketRate": obj.get("fixedPacketRate"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "fixedPacketRate": obj.get("fixedPacketRate") }) return _obj diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test_response.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test_response.py new file mode 100644 index 000000000..e5d8d0701 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test_response.py @@ -0,0 +1,195 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.agent_response import AgentResponse +from thousandeyes_sdk.instant_tests.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol +from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.instant_tests.models.test_direction import TestDirection +from thousandeyes_sdk.instant_tests.models.test_dscp_id import TestDscpId +from thousandeyes_sdk.instant_tests.models.test_label import TestLabel +from thousandeyes_sdk.instant_tests.models.test_links import TestLinks +from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode +from typing import Optional, Set +from typing_extensions import Self + +class AgentToAgentInstantTestResponse(BaseModel): + """ + AgentToAgentInstantTestResponse + """ # noqa: E501 + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + direction: Optional[TestDirection] = None + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + mss: Optional[Annotated[int, Field(le=1400, strict=True, ge=20)]] = Field(default=None, description="Maximum segment size, in bytes.") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + protocol: Optional[AgentToAgentTestProtocol] = None + target_agent_id: StrictStr = Field(description="`agentId` of the target agent for the test.", alias="targetAgentId") + throughput_measurements: Optional[StrictBool] = Field(default=False, description="Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent.", alias="throughputMeasurements") + throughput_duration: Optional[Annotated[int, Field(le=30000, strict=True, ge=5000)]] = Field(default=10000, description="The throughput duration.", alias="throughputDuration") + throughput_rate: Optional[Annotated[int, Field(le=1000, strict=True, ge=8)]] = Field(default=None, description="The throughput rate, only applicable for UDP protocol.", alias="throughputRate") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentToAgentInstantTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "dscp", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentToAgentInstantTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "direction": obj.get("direction"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "mss": obj.get("mss"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "protocol": obj.get("protocol"), + "targetAgentId": obj.get("targetAgentId"), + "throughputMeasurements": obj.get("throughputMeasurements") if obj.get("throughputMeasurements") is not None else False, + "throughputDuration": obj.get("throughputDuration") if obj.get("throughputDuration") is not None else 10000, + "throughputRate": obj.get("throughputRate"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test.py index 739612ccb..6b408d741 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.instant_tests.models.agent import Agent from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.instant_tests.models.test_dscp_id import TestDscpId from thousandeyes_sdk.instant_tests.models.test_ipv6_policy import TestIpv6Policy @@ -64,8 +63,7 @@ class AgentToServerInstantTest(BaseModel): ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") ping_payload_size: Optional[Annotated[int, Field(le=1400, strict=True, ge=0)]] = Field(default=None, description="Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests.", alias="pingPayloadSize") network_measurements: Optional[StrictBool] = Field(default=False, description="View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements.", alias="networkMeasurements") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements"] model_config = ConfigDict( populate_by_name=True, @@ -109,7 +107,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -123,7 +120,6 @@ def to_dict(self) -> Dict[str, Any]: "labels", "shared_with_accounts", "dscp", - "agents", ]) _dict = self.model_dump( @@ -148,13 +144,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -194,8 +183,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "dscpId": obj.get("dscpId"), "ipv6Policy": obj.get("ipv6Policy"), "pingPayloadSize": obj.get("pingPayloadSize"), - "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else False, - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else False }) return _obj diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test_response.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test_response.py new file mode 100644 index 000000000..adf81ee8f --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test_response.py @@ -0,0 +1,200 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.agent_response import AgentResponse +from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.instant_tests.models.test_dscp_id import TestDscpId +from thousandeyes_sdk.instant_tests.models.test_ipv6_policy import TestIpv6Policy +from thousandeyes_sdk.instant_tests.models.test_label import TestLabel +from thousandeyes_sdk.instant_tests.models.test_links import TestLinks +from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.instant_tests.models.test_protocol import TestProtocol +from typing import Optional, Set +from typing_extensions import Self + +class AgentToServerInstantTestResponse(BaseModel): + """ + AgentToServerInstantTestResponse + """ # noqa: E501 + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + continuous_mode: Optional[StrictBool] = Field(default=None, description="To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. ", alias="continuousMode") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1`", alias="fixedPacketRate") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + server: StrictStr = Field(description="Target name or IP address.") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + ping_payload_size: Optional[Annotated[int, Field(le=1400, strict=True, ge=0)]] = Field(default=None, description="Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests.", alias="pingPayloadSize") + network_measurements: Optional[StrictBool] = Field(default=False, description="View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements.", alias="networkMeasurements") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentToServerInstantTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "dscp", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentToServerInstantTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "continuousMode": obj.get("continuousMode"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "ipv6Policy": obj.get("ipv6Policy"), + "pingPayloadSize": obj.get("pingPayloadSize"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else False, + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/api_instant_test.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/api_instant_test.py index dce2f8398..19a25f4a1 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/api_instant_test.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/api_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.instant_tests.models.agent import Agent from thousandeyes_sdk.instant_tests.models.api_predefined_variable import ApiPredefinedVariable from thousandeyes_sdk.instant_tests.models.api_request import ApiRequest from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount @@ -50,10 +49,13 @@ class ApiInstantTest(BaseModel): links: Optional[TestLinks] = Field(default=None, alias="_links") labels: Optional[List[TestLabel]] = None shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") predefined_variables: Optional[List[ApiPredefinedVariable]] = Field(default=None, alias="predefinedVariables") probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") @@ -63,9 +65,8 @@ class ApiInstantTest(BaseModel): target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=0)]] = Field(default=None, description="Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior)", alias="targetTime") time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error.", alias="timeLimit") url: StrictStr = Field(description="Target for the test.") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "agents", "credentials"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "collectProxyNetworkData", "followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "overrideAgentProxy", "overrideProxyId", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "credentials"] model_config = ConfigDict( populate_by_name=True, @@ -108,7 +109,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -121,7 +121,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", ]) _dict = self.model_dump( @@ -160,13 +159,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['requests'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -192,10 +184,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, "mtuMeasurements": obj.get("mtuMeasurements"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), "pathTraceMode": obj.get("pathTraceMode"), "predefinedVariables": [ApiPredefinedVariable.from_dict(_item) for _item in obj["predefinedVariables"]] if obj.get("predefinedVariables") is not None else None, "probeMode": obj.get("probeMode"), @@ -205,7 +200,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "targetTime": obj.get("targetTime"), "timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30, "url": obj.get("url"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, "credentials": obj.get("credentials") }) return _obj diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/api_instant_test_request.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/api_instant_test_request.py index 11950e31b..0bad42613 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/api_instant_test_request.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/api_instant_test_request.py @@ -48,10 +48,13 @@ class ApiInstantTestRequest(BaseModel): links: Optional[TestLinks] = Field(default=None, alias="_links") labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).") shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint).", alias="sharedWithAccounts") + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") predefined_variables: Optional[List[ApiPredefinedVariable]] = Field(default=None, alias="predefinedVariables") probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") @@ -61,9 +64,9 @@ class ApiInstantTestRequest(BaseModel): target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=0)]] = Field(default=None, description="Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior)", alias="targetTime") time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error.", alias="timeLimit") url: StrictStr = Field(description="Target for the test.") - agents: List[TestAgent] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).") credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "agents", "credentials"] + agents: List[TestAgent] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "collectProxyNetworkData", "followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "overrideAgentProxy", "overrideProxyId", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "credentials", "agents"] model_config = ConfigDict( populate_by_name=True, @@ -170,10 +173,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "labels": obj.get("labels"), "sharedWithAccounts": obj.get("sharedWithAccounts"), + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, "mtuMeasurements": obj.get("mtuMeasurements"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), "pathTraceMode": obj.get("pathTraceMode"), "predefinedVariables": [ApiPredefinedVariable.from_dict(_item) for _item in obj["predefinedVariables"]] if obj.get("predefinedVariables") is not None else None, "probeMode": obj.get("probeMode"), @@ -183,8 +189,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "targetTime": obj.get("targetTime"), "timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30, "url": obj.get("url"), - "agents": [TestAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, - "credentials": obj.get("credentials") + "credentials": obj.get("credentials"), + "agents": [TestAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None }) return _obj diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/api_instant_test_response.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/api_instant_test_response.py new file mode 100644 index 000000000..acb38ee3a --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/api_instant_test_response.py @@ -0,0 +1,217 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.agent_response import AgentResponse +from thousandeyes_sdk.instant_tests.models.api_predefined_variable import ApiPredefinedVariable +from thousandeyes_sdk.instant_tests.models.api_request import ApiRequest +from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.instant_tests.models.test_label import TestLabel +from thousandeyes_sdk.instant_tests.models.test_links import TestLinks +from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.instant_tests.models.test_protocol import TestProtocol +from thousandeyes_sdk.instant_tests.models.test_ssl_version_id import TestSslVersionId +from typing import Optional, Set +from typing_extensions import Self + +class ApiInstantTestResponse(BaseModel): + """ + ApiInstantTestResponse + """ # noqa: E501 + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + predefined_variables: Optional[List[ApiPredefinedVariable]] = Field(default=None, alias="predefinedVariables") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + requests: List[ApiRequest] + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=0)]] = Field(default=None, description="Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior)", alias="targetTime") + time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error.", alias="timeLimit") + url: StrictStr = Field(description="Target for the test.") + credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "collectProxyNetworkData", "followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "overrideAgentProxy", "overrideProxyId", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "credentials", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApiInstantTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in predefined_variables (list) + _items = [] + if self.predefined_variables: + for _item in self.predefined_variables: + if _item: + _items.append(_item.to_dict()) + _dict['predefinedVariables'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in requests (list) + _items = [] + if self.requests: + for _item in self.requests: + if _item: + _items.append(_item.to_dict()) + _dict['requests'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiInstantTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), + "pathTraceMode": obj.get("pathTraceMode"), + "predefinedVariables": [ApiPredefinedVariable.from_dict(_item) for _item in obj["predefinedVariables"]] if obj.get("predefinedVariables") is not None else None, + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "requests": [ApiRequest.from_dict(_item) for _item in obj["requests"]] if obj.get("requests") is not None else None, + "sslVersionId": obj.get("sslVersionId"), + "targetTime": obj.get("targetTime"), + "timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30, + "url": obj.get("url"), + "credentials": obj.get("credentials"), + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/api_properties.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/api_properties.py index 840e57c83..ece61faaa 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/api_properties.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/api_properties.py @@ -32,10 +32,13 @@ class ApiProperties(BaseModel): """ ApiProperties """ # noqa: E501 + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") predefined_variables: Optional[List[ApiPredefinedVariable]] = Field(default=None, alias="predefinedVariables") probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") @@ -46,7 +49,7 @@ class ApiProperties(BaseModel): time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error.", alias="timeLimit") url: StrictStr = Field(description="Target for the test.") type: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "type"] + __properties: ClassVar[List[str]] = ["collectProxyNetworkData", "followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "overrideAgentProxy", "overrideProxyId", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "type"] model_config = ConfigDict( populate_by_name=True, @@ -116,10 +119,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, "mtuMeasurements": obj.get("mtuMeasurements"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), "pathTraceMode": obj.get("pathTraceMode"), "predefinedVariables": [ApiPredefinedVariable.from_dict(_item) for _item in obj["predefinedVariables"]] if obj.get("predefinedVariables") is not None else None, "probeMode": obj.get("probeMode"), diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_sec_instant_test.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_sec_instant_test.py index bfd9cbd47..199e9be30 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_sec_instant_test.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_sec_instant_test.py @@ -19,7 +19,6 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.instant_tests.models.agent import Agent from thousandeyes_sdk.instant_tests.models.dns_query_class import DnsQueryClass from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.instant_tests.models.test_label import TestLabel @@ -46,8 +45,7 @@ class DnsSecInstantTest(BaseModel): shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "domain", "dnsQueryClass", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "domain", "dnsQueryClass"] model_config = ConfigDict( populate_by_name=True, @@ -90,7 +88,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -103,7 +100,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", ]) _dict = self.model_dump( @@ -128,13 +124,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -161,8 +150,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, "domain": obj.get("domain"), - "dnsQueryClass": obj.get("dnsQueryClass"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "dnsQueryClass": obj.get("dnsQueryClass") }) return _obj diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_sec_instant_test_response.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_sec_instant_test_response.py new file mode 100644 index 000000000..7ccd7cb6f --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_sec_instant_test_response.py @@ -0,0 +1,167 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.instant_tests.models.agent_response import AgentResponse +from thousandeyes_sdk.instant_tests.models.dns_query_class import DnsQueryClass +from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.instant_tests.models.test_label import TestLabel +from thousandeyes_sdk.instant_tests.models.test_links import TestLinks +from typing import Optional, Set +from typing_extensions import Self + +class DnsSecInstantTestResponse(BaseModel): + """ + DnsSecInstantTestResponse + """ # noqa: E501 + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "domain", "dnsQueryClass", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsSecInstantTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DnsSecInstantTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass"), + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_server_instant_test.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_server_instant_test.py index 595974b21..5e615f65a 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_server_instant_test.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_server_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.instant_tests.models.agent import Agent from thousandeyes_sdk.instant_tests.models.dns_query_class import DnsQueryClass from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.instant_tests.models.test_dns_server import TestDnsServer @@ -65,8 +64,7 @@ class DnsServerInstantTest(BaseModel): ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "dnsServers", "dnsTransportProtocol", "domain", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "probeMode", "protocol", "recursiveQueries", "ipv6Policy", "fixedPacketRate", "dnsQueryClass", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "dnsServers", "dnsTransportProtocol", "domain", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "probeMode", "protocol", "recursiveQueries", "ipv6Policy", "fixedPacketRate", "dnsQueryClass"] model_config = ConfigDict( populate_by_name=True, @@ -109,7 +107,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -122,7 +119,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", ]) _dict = self.model_dump( @@ -154,13 +150,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['dnsServers'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -199,8 +188,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "recursiveQueries": obj.get("recursiveQueries"), "ipv6Policy": obj.get("ipv6Policy"), "fixedPacketRate": obj.get("fixedPacketRate"), - "dnsQueryClass": obj.get("dnsQueryClass"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "dnsQueryClass": obj.get("dnsQueryClass") }) return _obj diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_server_instant_test_response.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_server_instant_test_response.py new file mode 100644 index 000000000..5cda2a139 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_server_instant_test_response.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.agent_response import AgentResponse +from thousandeyes_sdk.instant_tests.models.dns_query_class import DnsQueryClass +from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.instant_tests.models.test_dns_server import TestDnsServer +from thousandeyes_sdk.instant_tests.models.test_dns_transport_protocol import TestDnsTransportProtocol +from thousandeyes_sdk.instant_tests.models.test_ipv6_policy import TestIpv6Policy +from thousandeyes_sdk.instant_tests.models.test_label import TestLabel +from thousandeyes_sdk.instant_tests.models.test_links import TestLinks +from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.instant_tests.models.test_protocol import TestProtocol +from typing import Optional, Set +from typing_extensions import Self + +class DnsServerInstantTestResponse(BaseModel): + """ + DnsServerInstantTestResponse + """ # noqa: E501 + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + dns_servers: List[TestDnsServer] = Field(alias="dnsServers") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + recursive_queries: Optional[StrictBool] = Field(default=None, description="Set true to run query with RD (recursion desired) flag enabled.", alias="recursiveQueries") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "dnsServers", "dnsTransportProtocol", "domain", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "probeMode", "protocol", "recursiveQueries", "ipv6Policy", "fixedPacketRate", "dnsQueryClass", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsServerInstantTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in dns_servers (list) + _items = [] + if self.dns_servers: + for _item in self.dns_servers: + if _item: + _items.append(_item.to_dict()) + _dict['dnsServers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DnsServerInstantTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "dnsServers": [TestDnsServer.from_dict(_item) for _item in obj["dnsServers"]] if obj.get("dnsServers") is not None else None, + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "recursiveQueries": obj.get("recursiveQueries"), + "ipv6Policy": obj.get("ipv6Policy"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "dnsQueryClass": obj.get("dnsQueryClass"), + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_trace_instant_test.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_trace_instant_test.py index 6c0c91d75..4aec8672e 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_trace_instant_test.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_trace_instant_test.py @@ -19,7 +19,6 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.instant_tests.models.agent import Agent from thousandeyes_sdk.instant_tests.models.dns_query_class import DnsQueryClass from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.instant_tests.models.test_dns_transport_protocol import TestDnsTransportProtocol @@ -48,8 +47,7 @@ class DnsTraceInstantTest(BaseModel): dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "dnsTransportProtocol", "domain", "dnsQueryClass", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "dnsTransportProtocol", "domain", "dnsQueryClass"] model_config = ConfigDict( populate_by_name=True, @@ -92,7 +90,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -105,7 +102,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", ]) _dict = self.model_dump( @@ -130,13 +126,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -164,8 +153,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, "dnsTransportProtocol": obj.get("dnsTransportProtocol"), "domain": obj.get("domain"), - "dnsQueryClass": obj.get("dnsQueryClass"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "dnsQueryClass": obj.get("dnsQueryClass") }) return _obj diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_trace_instant_test_response.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_trace_instant_test_response.py new file mode 100644 index 000000000..30a8579cc --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/dns_trace_instant_test_response.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.instant_tests.models.agent_response import AgentResponse +from thousandeyes_sdk.instant_tests.models.dns_query_class import DnsQueryClass +from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.instant_tests.models.test_dns_transport_protocol import TestDnsTransportProtocol +from thousandeyes_sdk.instant_tests.models.test_label import TestLabel +from thousandeyes_sdk.instant_tests.models.test_links import TestLinks +from typing import Optional, Set +from typing_extensions import Self + +class DnsTraceInstantTestResponse(BaseModel): + """ + DnsTraceInstantTestResponse + """ # noqa: E501 + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "dnsTransportProtocol", "domain", "dnsQueryClass", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsTraceInstantTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DnsTraceInstantTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass"), + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/expand_instant_test_options.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/expand_instant_test_options.py new file mode 100644 index 000000000..15dfffa62 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/expand_instant_test_options.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ExpandInstantTestOptions(str, Enum): + """ + ExpandInstantTestOptions + """ + + """ + allowed enum values + """ + AGENT = 'agent' + LABEL = 'label' + SHARED_MINUS_WITH_MINUS_ACCOUNT = 'shared-with-account' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ExpandInstantTestOptions from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/ftp_server_instant_test.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/ftp_server_instant_test.py index c9a927792..a713a7f03 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/ftp_server_instant_test.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/ftp_server_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.instant_tests.models.agent import Agent from thousandeyes_sdk.instant_tests.models.ftp_server_request_type import FtpServerRequestType from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.instant_tests.models.test_ipv6_policy import TestIpv6Policy @@ -67,8 +66,7 @@ class FtpServerInstantTest(BaseModel): username: StrictStr = Field(description="Username for Basic/NTLM authentication.") fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "downloadLimit", "ftpTargetTime", "ftpTimeLimit", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "requestType", "url", "useActiveFtp", "useExplicitFtps", "username", "fixedPacketRate", "ipv6Policy", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "downloadLimit", "ftpTargetTime", "ftpTimeLimit", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "requestType", "url", "useActiveFtp", "useExplicitFtps", "username", "fixedPacketRate", "ipv6Policy"] model_config = ConfigDict( populate_by_name=True, @@ -111,7 +109,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -124,7 +121,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", ]) _dict = self.model_dump( @@ -149,13 +145,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -198,8 +187,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "useExplicitFtps": obj.get("useExplicitFtps"), "username": obj.get("username"), "fixedPacketRate": obj.get("fixedPacketRate"), - "ipv6Policy": obj.get("ipv6Policy"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "ipv6Policy": obj.get("ipv6Policy") }) return _obj diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/ftp_server_instant_test_request.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/ftp_server_instant_test_request.py new file mode 100644 index 000000000..cdd2b75e7 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/ftp_server_instant_test_request.py @@ -0,0 +1,184 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.ftp_server_request_type import FtpServerRequestType +from thousandeyes_sdk.instant_tests.models.test_agent import TestAgent +from thousandeyes_sdk.instant_tests.models.test_ipv6_policy import TestIpv6Policy +from thousandeyes_sdk.instant_tests.models.test_links import TestLinks +from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.instant_tests.models.test_protocol import TestProtocol +from typing import Optional, Set +from typing_extensions import Self + +class FtpServerInstantTestRequest(BaseModel): + """ + FtpServerInstantTestRequest + """ # noqa: E501 + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint).", alias="sharedWithAccounts") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + download_limit: Optional[StrictInt] = Field(default=None, description="Specify maximum number of bytes to download from the target object.", alias="downloadLimit") + ftp_target_time: Optional[Annotated[int, Field(le=6000, strict=True, ge=1000)]] = Field(default=None, description="Target time for operation completion; specified in milliseconds.", alias="ftpTargetTime") + ftp_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=10)]] = Field(default=10, description="Set the time limit for the test in seconds.", alias="ftpTimeLimit") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: StrictStr = Field(description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + request_type: FtpServerRequestType = Field(alias="requestType") + url: StrictStr = Field(description="Target for the test.") + use_active_ftp: Optional[StrictBool] = Field(default=False, description="Explicitly set the flag to use active FTP.", alias="useActiveFtp") + use_explicit_ftps: Optional[StrictBool] = Field(default=None, description="Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS.", alias="useExplicitFtps") + username: StrictStr = Field(description="Username for Basic/NTLM authentication.") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + agents: List[TestAgent] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "downloadLimit", "ftpTargetTime", "ftpTimeLimit", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "requestType", "url", "useActiveFtp", "useExplicitFtps", "username", "fixedPacketRate", "ipv6Policy", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FtpServerInstantTestRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FtpServerInstantTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "downloadLimit": obj.get("downloadLimit"), + "ftpTargetTime": obj.get("ftpTargetTime"), + "ftpTimeLimit": obj.get("ftpTimeLimit") if obj.get("ftpTimeLimit") is not None else 10, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "requestType": obj.get("requestType"), + "url": obj.get("url"), + "useActiveFtp": obj.get("useActiveFtp") if obj.get("useActiveFtp") is not None else False, + "useExplicitFtps": obj.get("useExplicitFtps"), + "username": obj.get("username"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy"), + "agents": [TestAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/ftp_server_instant_test_response.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/ftp_server_instant_test_response.py new file mode 100644 index 000000000..c393e5347 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/ftp_server_instant_test_response.py @@ -0,0 +1,204 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.agent_response import AgentResponse +from thousandeyes_sdk.instant_tests.models.ftp_server_request_type import FtpServerRequestType +from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.instant_tests.models.test_ipv6_policy import TestIpv6Policy +from thousandeyes_sdk.instant_tests.models.test_label import TestLabel +from thousandeyes_sdk.instant_tests.models.test_links import TestLinks +from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.instant_tests.models.test_protocol import TestProtocol +from typing import Optional, Set +from typing_extensions import Self + +class FtpServerInstantTestResponse(BaseModel): + """ + FtpServerInstantTestResponse + """ # noqa: E501 + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + download_limit: Optional[StrictInt] = Field(default=None, description="Specify maximum number of bytes to download from the target object.", alias="downloadLimit") + ftp_target_time: Optional[Annotated[int, Field(le=6000, strict=True, ge=1000)]] = Field(default=None, description="Target time for operation completion; specified in milliseconds.", alias="ftpTargetTime") + ftp_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=10)]] = Field(default=10, description="Set the time limit for the test in seconds.", alias="ftpTimeLimit") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: StrictStr = Field(description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + request_type: FtpServerRequestType = Field(alias="requestType") + url: StrictStr = Field(description="Target for the test.") + use_active_ftp: Optional[StrictBool] = Field(default=False, description="Explicitly set the flag to use active FTP.", alias="useActiveFtp") + use_explicit_ftps: Optional[StrictBool] = Field(default=None, description="Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS.", alias="useExplicitFtps") + username: StrictStr = Field(description="Username for Basic/NTLM authentication.") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "downloadLimit", "ftpTargetTime", "ftpTimeLimit", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "requestType", "url", "useActiveFtp", "useExplicitFtps", "username", "fixedPacketRate", "ipv6Policy", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FtpServerInstantTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FtpServerInstantTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "downloadLimit": obj.get("downloadLimit"), + "ftpTargetTime": obj.get("ftpTargetTime"), + "ftpTimeLimit": obj.get("ftpTimeLimit") if obj.get("ftpTimeLimit") is not None else 10, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "requestType": obj.get("requestType"), + "url": obj.get("url"), + "useActiveFtp": obj.get("useActiveFtp") if obj.get("useActiveFtp") is not None else False, + "useExplicitFtps": obj.get("useExplicitFtps"), + "username": obj.get("username"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy"), + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_base_properties.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_base_properties.py index 2243e5ec0..60e28f2bb 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_base_properties.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_base_properties.py @@ -40,7 +40,7 @@ class HttpServerBaseProperties(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -139,7 +139,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_instant_test.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_instant_test.py index 766103365..8c11d71bd 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_instant_test.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.instant_tests.models.agent import Agent from thousandeyes_sdk.instant_tests.models.agent_interfaces import AgentInterfaces from thousandeyes_sdk.instant_tests.models.o_auth import OAuth from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount @@ -59,7 +58,7 @@ class HttpServerInstantTest(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -90,8 +89,7 @@ class HttpServerInstantTest(BaseModel): headers: Optional[List[StrictStr]] = Field(default=None, description="HTTP request headers used.") post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "headers", "postBody", "ipv6Policy", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "headers", "postBody", "ipv6Policy"] model_config = ConfigDict( populate_by_name=True, @@ -135,7 +133,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -149,7 +146,6 @@ def to_dict(self) -> Dict[str, Any]: "labels", "shared_with_accounts", "ssl_version", - "agents", ]) _dict = self.model_dump( @@ -183,13 +179,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of o_auth if self.o_auth: _dict['oAuth'] = self.o_auth.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -221,7 +210,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), @@ -251,8 +240,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, "headers": obj.get("headers"), "postBody": obj.get("postBody"), - "ipv6Policy": obj.get("ipv6Policy"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "ipv6Policy": obj.get("ipv6Policy") }) return _obj diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_instant_test_request.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_instant_test_request.py index cc6f5d0a5..f96dee153 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_instant_test_request.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_instant_test_request.py @@ -57,7 +57,7 @@ class HttpServerInstantTestRequest(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -199,7 +199,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_instant_test_response.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_instant_test_response.py new file mode 100644 index 000000000..8b999357e --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_instant_test_response.py @@ -0,0 +1,257 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.agent_interfaces import AgentInterfaces +from thousandeyes_sdk.instant_tests.models.agent_response import AgentResponse +from thousandeyes_sdk.instant_tests.models.o_auth import OAuth +from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.instant_tests.models.test_auth_type import TestAuthType +from thousandeyes_sdk.instant_tests.models.test_custom_headers import TestCustomHeaders +from thousandeyes_sdk.instant_tests.models.test_ipv6_policy import TestIpv6Policy +from thousandeyes_sdk.instant_tests.models.test_label import TestLabel +from thousandeyes_sdk.instant_tests.models.test_links import TestLinks +from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.instant_tests.models.test_protocol import TestProtocol +from thousandeyes_sdk.instant_tests.models.test_ssl_version_id import TestSslVersionId +from typing import Optional, Set +from typing_extensions import Self + +class HttpServerInstantTestResponse(BaseModel): + """ + HttpServerInstantTestResponse + """ # noqa: E501 + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + agent_interfaces: Optional[AgentInterfaces] = Field(default=None, alias="agentInterfaces") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") + download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") + dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + o_auth: Optional[OAuth] = Field(default=None, alias="oAuth") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + allow_unsafe_legacy_renegotiation: Optional[StrictBool] = Field(default=True, description="Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation.", alias="allowUnsafeLegacyRenegotiation") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") + headers: Optional[List[StrictStr]] = Field(default=None, description="HTTP request headers used.") + post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "headers", "postBody", "ipv6Policy", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HttpServerInstantTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "ssl_version", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of agent_interfaces + if self.agent_interfaces: + _dict['agentInterfaces'] = self.agent_interfaces.to_dict() + # override the default output from pydantic by calling `to_dict()` of custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + # override the default output from pydantic by calling `to_dict()` of o_auth + if self.o_auth: + _dict['oAuth'] = self.o_auth.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HttpServerInstantTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "authType": obj.get("authType"), + "agentInterfaces": AgentInterfaces.from_dict(obj["agentInterfaces"]) if obj.get("agentInterfaces") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', + "downloadLimit": obj.get("downloadLimit"), + "dnsOverride": obj.get("dnsOverride"), + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "oAuth": OAuth.from_dict(obj["oAuth"]) if obj.get("oAuth") is not None else None, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "allowUnsafeLegacyRenegotiation": obj.get("allowUnsafeLegacyRenegotiation") if obj.get("allowUnsafeLegacyRenegotiation") is not None else True, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "fixedPacketRate": obj.get("fixedPacketRate"), + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, + "headers": obj.get("headers"), + "postBody": obj.get("postBody"), + "ipv6Policy": obj.get("ipv6Policy"), + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_properties.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_properties.py index 6ef8bcfab..3f3cbabdd 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_properties.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/http_server_properties.py @@ -41,7 +41,7 @@ class HttpServerProperties(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -146,7 +146,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/page_load_instant_test.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/page_load_instant_test.py index d5f545bcd..87f524d90 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/page_load_instant_test.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/page_load_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.instant_tests.models.agent import Agent from thousandeyes_sdk.instant_tests.models.agent_interfaces import AgentInterfaces from thousandeyes_sdk.instant_tests.models.o_auth import OAuth from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount @@ -59,7 +58,7 @@ class PageLoadInstantTest(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -96,8 +95,7 @@ class PageLoadInstantTest(BaseModel): allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "pageLoadTargetTime", "pageLoadTimeLimit", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "pageLoadTargetTime", "pageLoadTimeLimit", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy"] model_config = ConfigDict( populate_by_name=True, @@ -141,7 +139,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -155,7 +152,6 @@ def to_dict(self) -> Dict[str, Any]: "labels", "shared_with_accounts", "ssl_version", - "agents", ]) _dict = self.model_dump( @@ -189,13 +185,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of o_auth if self.o_auth: _dict['oAuth'] = self.o_auth.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -227,7 +216,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), @@ -263,8 +252,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, "browserLanguage": obj.get("browserLanguage"), - "pageLoadingStrategy": obj.get("pageLoadingStrategy"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "pageLoadingStrategy": obj.get("pageLoadingStrategy") }) return _obj diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/page_load_instant_test_request.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/page_load_instant_test_request.py index 291844822..2c784cb0a 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/page_load_instant_test_request.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/page_load_instant_test_request.py @@ -57,7 +57,7 @@ class PageLoadInstantTestRequest(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -205,7 +205,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/page_load_instant_test_response.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/page_load_instant_test_response.py new file mode 100644 index 000000000..923dd8673 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/page_load_instant_test_response.py @@ -0,0 +1,269 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.agent_interfaces import AgentInterfaces +from thousandeyes_sdk.instant_tests.models.agent_response import AgentResponse +from thousandeyes_sdk.instant_tests.models.o_auth import OAuth +from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.instant_tests.models.test_auth_type import TestAuthType +from thousandeyes_sdk.instant_tests.models.test_custom_headers import TestCustomHeaders +from thousandeyes_sdk.instant_tests.models.test_label import TestLabel +from thousandeyes_sdk.instant_tests.models.test_links import TestLinks +from thousandeyes_sdk.instant_tests.models.test_page_loading_strategy import TestPageLoadingStrategy +from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.instant_tests.models.test_protocol import TestProtocol +from thousandeyes_sdk.instant_tests.models.test_ssl_version_id import TestSslVersionId +from typing import Optional, Set +from typing_extensions import Self + +class PageLoadInstantTestResponse(BaseModel): + """ + PageLoadInstantTestResponse + """ # noqa: E501 + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + agent_interfaces: Optional[AgentInterfaces] = Field(default=None, alias="agentInterfaces") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") + download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") + dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + o_auth: Optional[OAuth] = Field(default=None, alias="oAuth") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + allow_unsafe_legacy_renegotiation: Optional[StrictBool] = Field(default=True, description="Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation.", alias="allowUnsafeLegacyRenegotiation") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") + emulated_device_id: Optional[StrictStr] = Field(default=None, description="ID of the emulated device, if one was given when the test was created.", alias="emulatedDeviceId") + page_load_target_time: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`.", alias="pageLoadTargetTime") + page_load_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=10, description="Page load time limit. Must be larger than the `httpTimeLimit`.", alias="pageLoadTimeLimit") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "pageLoadTargetTime", "pageLoadTimeLimit", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PageLoadInstantTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "ssl_version", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of agent_interfaces + if self.agent_interfaces: + _dict['agentInterfaces'] = self.agent_interfaces.to_dict() + # override the default output from pydantic by calling `to_dict()` of custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + # override the default output from pydantic by calling `to_dict()` of o_auth + if self.o_auth: + _dict['oAuth'] = self.o_auth.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PageLoadInstantTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "authType": obj.get("authType"), + "agentInterfaces": AgentInterfaces.from_dict(obj["agentInterfaces"]) if obj.get("agentInterfaces") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', + "downloadLimit": obj.get("downloadLimit"), + "dnsOverride": obj.get("dnsOverride"), + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "oAuth": OAuth.from_dict(obj["oAuth"]) if obj.get("oAuth") is not None else None, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "allowUnsafeLegacyRenegotiation": obj.get("allowUnsafeLegacyRenegotiation") if obj.get("allowUnsafeLegacyRenegotiation") is not None else True, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "fixedPacketRate": obj.get("fixedPacketRate"), + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, + "emulatedDeviceId": obj.get("emulatedDeviceId"), + "pageLoadTargetTime": obj.get("pageLoadTargetTime"), + "pageLoadTimeLimit": obj.get("pageLoadTimeLimit") if obj.get("pageLoadTimeLimit") is not None else 10, + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/page_load_properties.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/page_load_properties.py index 4b9d30abd..9b4103d01 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/page_load_properties.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/page_load_properties.py @@ -41,7 +41,7 @@ class PageLoadProperties(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -152,7 +152,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/sip_server_instant_test.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/sip_server_instant_test.py index 46aaacb9f..b9e60ff4c 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/sip_server_instant_test.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/sip_server_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.instant_tests.models.agent import Agent from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.instant_tests.models.test_ipv6_policy import TestIpv6Policy from thousandeyes_sdk.instant_tests.models.test_label import TestLabel @@ -58,8 +57,7 @@ class SipServerInstantTest(BaseModel): sip_time_limit: Optional[Annotated[int, Field(le=10, strict=True, ge=5)]] = Field(default=5, description="Time limit in milliseconds.", alias="sipTimeLimit") fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "mtuMeasurements", "networkMeasurements", "numPathTraces", "optionsRegex", "pathTraceMode", "probeMode", "registerEnabled", "sipTargetTime", "sipTimeLimit", "fixedPacketRate", "ipv6Policy", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "mtuMeasurements", "networkMeasurements", "numPathTraces", "optionsRegex", "pathTraceMode", "probeMode", "registerEnabled", "sipTargetTime", "sipTimeLimit", "fixedPacketRate", "ipv6Policy"] model_config = ConfigDict( populate_by_name=True, @@ -102,7 +100,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -115,7 +112,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", ]) _dict = self.model_dump( @@ -140,13 +136,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -182,8 +171,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "sipTargetTime": obj.get("sipTargetTime"), "sipTimeLimit": obj.get("sipTimeLimit") if obj.get("sipTimeLimit") is not None else 5, "fixedPacketRate": obj.get("fixedPacketRate"), - "ipv6Policy": obj.get("ipv6Policy"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "ipv6Policy": obj.get("ipv6Policy") }) return _obj diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/sip_server_instant_test_response.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/sip_server_instant_test_response.py index 1fffb1315..daf781a53 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/sip_server_instant_test_response.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/sip_server_instant_test_response.py @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.instant_tests.models.agent import Agent +from thousandeyes_sdk.instant_tests.models.agent_response import AgentResponse from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.instant_tests.models.sip_test_protocol import SipTestProtocol from thousandeyes_sdk.instant_tests.models.test_ipv6_policy import TestIpv6Policy @@ -59,14 +59,14 @@ class SipServerInstantTestResponse(BaseModel): sip_time_limit: Optional[Annotated[int, Field(le=10, strict=True, ge=5)]] = Field(default=5, description="Time limit in milliseconds.", alias="sipTimeLimit") fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") auth_user: Optional[StrictStr] = Field(default=None, description="Username for authentication with SIP server.", alias="authUser") password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") port: Annotated[int, Field(le=65535, strict=True, ge=1)] = Field(description="Target port.") protocol: Optional[SipTestProtocol] = None sip_registrar: Optional[StrictStr] = Field(default=None, description="SIP server to be tested, specified by domain name or IP address.", alias="sipRegistrar") user: Optional[StrictStr] = Field(default=None, description="Username for SIP registration, should be unique within a ThousandEyes account group.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "mtuMeasurements", "networkMeasurements", "numPathTraces", "optionsRegex", "pathTraceMode", "probeMode", "registerEnabled", "sipTargetTime", "sipTimeLimit", "fixedPacketRate", "ipv6Policy", "agents", "authUser", "password", "port", "protocol", "sipRegistrar", "user"] + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "mtuMeasurements", "networkMeasurements", "numPathTraces", "optionsRegex", "pathTraceMode", "probeMode", "registerEnabled", "sipTargetTime", "sipTimeLimit", "fixedPacketRate", "ipv6Policy", "authUser", "password", "port", "protocol", "sipRegistrar", "user", "agents"] model_config = ConfigDict( populate_by_name=True, @@ -109,7 +109,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -122,7 +121,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", ]) _dict = self.model_dump( @@ -190,13 +188,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "sipTimeLimit": obj.get("sipTimeLimit") if obj.get("sipTimeLimit") is not None else 5, "fixedPacketRate": obj.get("fixedPacketRate"), "ipv6Policy": obj.get("ipv6Policy"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, "authUser": obj.get("authUser"), "password": obj.get("password"), "port": obj.get("port") if obj.get("port") is not None else 49153, "protocol": obj.get("protocol"), "sipRegistrar": obj.get("sipRegistrar"), - "user": obj.get("user") + "user": obj.get("user"), + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None }) return _obj diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/voice_instant_test.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/voice_instant_test.py index f910e1b01..65b0b474d 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/voice_instant_test.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/voice_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.instant_tests.models.agent import Agent from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.instant_tests.models.test_dscp_id import TestDscpId from thousandeyes_sdk.instant_tests.models.test_label import TestLabel @@ -54,8 +53,7 @@ class VoiceInstantTest(BaseModel): num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1024)]] = Field(default=None, description="Port number for the chosen protocol.") target_agent_id: StrictStr = Field(description="Agent ID of the target agent for the test.", alias="targetAgentId") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId"] model_config = ConfigDict( populate_by_name=True, @@ -100,7 +98,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -115,7 +112,6 @@ def to_dict(self) -> Dict[str, Any]: "shared_with_accounts", "codec", "dscp", - "agents", ]) _dict = self.model_dump( @@ -140,13 +136,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -180,8 +169,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "jitterBuffer": obj.get("jitterBuffer") if obj.get("jitterBuffer") is not None else 40, "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, "port": obj.get("port"), - "targetAgentId": obj.get("targetAgentId"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "targetAgentId": obj.get("targetAgentId") }) return _obj diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/voice_instant_test_response.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/voice_instant_test_response.py new file mode 100644 index 000000000..1fbcb5389 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/voice_instant_test_response.py @@ -0,0 +1,186 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.agent_response import AgentResponse +from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.instant_tests.models.test_dscp_id import TestDscpId +from thousandeyes_sdk.instant_tests.models.test_label import TestLabel +from thousandeyes_sdk.instant_tests.models.test_links import TestLinks +from typing import Optional, Set +from typing_extensions import Self + +class VoiceInstantTestResponse(BaseModel): + """ + VoiceInstantTestResponse + """ # noqa: E501 + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + codec: Optional[StrictStr] = Field(default=None, description="Codec label") + codec_id: Optional[StrictStr] = Field(default=None, description="Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab)", alias="codecId") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + duration: Optional[Annotated[int, Field(le=30, strict=True, ge=5)]] = Field(default=5, description="Duration of the test in seconds.") + jitter_buffer: Optional[Annotated[int, Field(le=150, strict=True, ge=0)]] = Field(default=40, description="De-jitter buffer size in seconds.", alias="jitterBuffer") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1024)]] = Field(default=None, description="Port number for the chosen protocol.") + target_agent_id: StrictStr = Field(description="Agent ID of the target agent for the test.", alias="targetAgentId") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of VoiceInstantTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "codec", + "dscp", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VoiceInstantTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "codec": obj.get("codec"), + "codecId": obj.get("codecId"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "duration": obj.get("duration") if obj.get("duration") is not None else 5, + "jitterBuffer": obj.get("jitterBuffer") if obj.get("jitterBuffer") is not None else 40, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "port": obj.get("port"), + "targetAgentId": obj.get("targetAgentId"), + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/web_transaction_instant_test.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/web_transaction_instant_test.py index 3bc48f2f0..bc9133f27 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/web_transaction_instant_test.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/web_transaction_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.instant_tests.models.agent import Agent from thousandeyes_sdk.instant_tests.models.agent_interfaces import AgentInterfaces from thousandeyes_sdk.instant_tests.models.o_auth import OAuth from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount @@ -59,7 +58,7 @@ class WebTransactionInstantTest(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -97,9 +96,8 @@ class WebTransactionInstantTest(BaseModel): allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "targetTime", "timeLimit", "transactionScript", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "agents", "credentials"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "targetTime", "timeLimit", "transactionScript", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "credentials"] model_config = ConfigDict( populate_by_name=True, @@ -143,7 +141,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -157,7 +154,6 @@ def to_dict(self) -> Dict[str, Any]: "labels", "shared_with_accounts", "ssl_version", - "agents", ]) _dict = self.model_dump( @@ -191,13 +187,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of o_auth if self.o_auth: _dict['oAuth'] = self.o_auth.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -229,7 +218,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), @@ -267,7 +256,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, "browserLanguage": obj.get("browserLanguage"), "pageLoadingStrategy": obj.get("pageLoadingStrategy"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, "credentials": obj.get("credentials") }) return _obj diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/web_transaction_instant_test_request.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/web_transaction_instant_test_request.py index 10179b4e7..321fd7692 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/web_transaction_instant_test_request.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/web_transaction_instant_test_request.py @@ -57,7 +57,7 @@ class WebTransactionInstantTestRequest(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -95,9 +95,9 @@ class WebTransactionInstantTestRequest(BaseModel): allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") - agents: List[TestAgent] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).") credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "targetTime", "timeLimit", "transactionScript", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "agents", "credentials"] + agents: List[TestAgent] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "targetTime", "timeLimit", "transactionScript", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "credentials", "agents"] model_config = ConfigDict( populate_by_name=True, @@ -207,7 +207,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), @@ -245,8 +245,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, "browserLanguage": obj.get("browserLanguage"), "pageLoadingStrategy": obj.get("pageLoadingStrategy"), - "agents": [TestAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, - "credentials": obj.get("credentials") + "credentials": obj.get("credentials"), + "agents": [TestAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None }) return _obj diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/web_transaction_instant_test_response.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/web_transaction_instant_test_response.py new file mode 100644 index 000000000..22cb7897b --- /dev/null +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/web_transaction_instant_test_response.py @@ -0,0 +1,273 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.instant_tests.models.agent_interfaces import AgentInterfaces +from thousandeyes_sdk.instant_tests.models.agent_response import AgentResponse +from thousandeyes_sdk.instant_tests.models.o_auth import OAuth +from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.instant_tests.models.test_auth_type import TestAuthType +from thousandeyes_sdk.instant_tests.models.test_custom_headers import TestCustomHeaders +from thousandeyes_sdk.instant_tests.models.test_label import TestLabel +from thousandeyes_sdk.instant_tests.models.test_links import TestLinks +from thousandeyes_sdk.instant_tests.models.test_page_loading_strategy import TestPageLoadingStrategy +from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.instant_tests.models.test_protocol import TestProtocol +from thousandeyes_sdk.instant_tests.models.test_ssl_version_id import TestSslVersionId +from typing import Optional, Set +from typing_extensions import Self + +class WebTransactionInstantTestResponse(BaseModel): + """ + WebTransactionInstantTestResponse + """ # noqa: E501 + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + agent_interfaces: Optional[AgentInterfaces] = Field(default=None, alias="agentInterfaces") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") + download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") + dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + o_auth: Optional[OAuth] = Field(default=None, alias="oAuth") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + allow_unsafe_legacy_renegotiation: Optional[StrictBool] = Field(default=True, description="Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation.", alias="allowUnsafeLegacyRenegotiation") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") + emulated_device_id: Optional[StrictStr] = Field(default=None, description="ID of the emulated device, if specified when the test was created.", alias="emulatedDeviceId") + target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=0)]] = Field(default=None, description="Target completion time. The default is 50% of the specified time limit in seconds. (Set to 0 to use the default behavior).", alias="targetTime") + time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds.", alias="timeLimit") + transaction_script: StrictStr = Field(description="JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ).", alias="transactionScript") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "targetTime", "timeLimit", "transactionScript", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "credentials", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebTransactionInstantTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "ssl_version", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of agent_interfaces + if self.agent_interfaces: + _dict['agentInterfaces'] = self.agent_interfaces.to_dict() + # override the default output from pydantic by calling `to_dict()` of custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + # override the default output from pydantic by calling `to_dict()` of o_auth + if self.o_auth: + _dict['oAuth'] = self.o_auth.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebTransactionInstantTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "authType": obj.get("authType"), + "agentInterfaces": AgentInterfaces.from_dict(obj["agentInterfaces"]) if obj.get("agentInterfaces") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', + "downloadLimit": obj.get("downloadLimit"), + "dnsOverride": obj.get("dnsOverride"), + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "oAuth": OAuth.from_dict(obj["oAuth"]) if obj.get("oAuth") is not None else None, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "allowUnsafeLegacyRenegotiation": obj.get("allowUnsafeLegacyRenegotiation") if obj.get("allowUnsafeLegacyRenegotiation") is not None else True, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "fixedPacketRate": obj.get("fixedPacketRate"), + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, + "emulatedDeviceId": obj.get("emulatedDeviceId"), + "targetTime": obj.get("targetTime"), + "timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30, + "transactionScript": obj.get("transactionScript"), + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "credentials": obj.get("credentials"), + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/web_transaction_properties.py b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/web_transaction_properties.py index 319a91bbb..61fcc64f3 100644 --- a/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/web_transaction_properties.py +++ b/thousandeyes-sdk-instant-tests/src/thousandeyes_sdk/instant_tests/models/web_transaction_properties.py @@ -41,7 +41,7 @@ class WebTransactionProperties(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -153,7 +153,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), diff --git a/thousandeyes-sdk-instant-tests/test/test_agent_to_agent_instant_tests_api.py b/thousandeyes-sdk-instant-tests/test/test_agent_to_agent_instant_tests_api.py new file mode 100644 index 000000000..17b1071ca --- /dev/null +++ b/thousandeyes-sdk-instant-tests/test/test_agent_to_agent_instant_tests_api.py @@ -0,0 +1,181 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.instant_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.instant_tests.api.agent_to_agent_instant_tests_api import AgentToAgentInstantTestsApi + + +class TestAgentToAgentInstantTestsApi(unittest.TestCase): + """AgentToAgentInstantTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = AgentToAgentInstantTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_agent_to_agent_instant_test_models_validation(self) -> None: + """Test case for create_agent_to_agent_instant_test request and response models""" + request_body_json = """ + { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "description" : "ThousandEyes Test", + "type" : "agent-to-agent", + "mss" : 100, + "dscpId" : "0", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "throughputRate" : 10, + "modifiedBy" : "user@user.com", + "testName" : "ThousandEyes Test", + "direction" : "to-target", + "throughputMeasurements" : false, + "numPathTraces" : 3, + "liveShare" : false, + "savedEvent" : true, + "throughputDuration" : 10000, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "2954", + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.instant_tests.models.AgentToAgentInstantTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "description" : "ThousandEyes Test", + "type" : "agent-to-agent", + "mss" : 100, + "dscpId" : "0", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "throughputRate" : 10, + "modifiedBy" : "user@user.com", + "testName" : "ThousandEyes Test", + "direction" : "to-target", + "throughputMeasurements" : false, + "numPathTraces" : 3, + "liveShare" : false, + "savedEvent" : true, + "throughputDuration" : 10000, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "2954", + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.instant_tests.models.AgentToAgentInstantTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-instant-tests/test/test_agent_to_server_instant_tests_api.py b/thousandeyes-sdk-instant-tests/test/test_agent_to_server_instant_tests_api.py new file mode 100644 index 000000000..02bf777c7 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/test/test_agent_to_server_instant_tests_api.py @@ -0,0 +1,185 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.instant_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.instant_tests.api.agent_to_server_instant_tests_api import AgentToServerInstantTestsApi + + +class TestAgentToServerInstantTestsApi(unittest.TestCase): + """AgentToServerInstantTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = AgentToServerInstantTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_agent_to_server_instant_test_models_validation(self) -> None: + """Test case for create_agent_to_server_instant_test request and response models""" + request_body_json = """ + { + "server" : "www.thousandeyes.com", + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "agent-to-server", + "dscpId" : "0", + "fixedPacketRate" : 25, + "protocol" : "tcp", + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : false, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "pingPayloadSize" : 112, + "continuousMode" : false + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.instant_tests.models.AgentToServerInstantTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "server" : "www.thousandeyes.com", + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "agent-to-server", + "dscpId" : "0", + "fixedPacketRate" : 25, + "protocol" : "tcp", + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : false, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "pingPayloadSize" : 112, + "continuousMode" : false + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.instant_tests.models.AgentToServerInstantTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-instant-tests/test/test_api_instant_tests_api.py b/thousandeyes-sdk-instant-tests/test/test_api_instant_tests_api.py new file mode 100644 index 000000000..52351cb54 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/test/test_api_instant_tests_api.py @@ -0,0 +1,337 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.instant_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.instant_tests.api.api_instant_tests_api import APIInstantTestsApi + + +class TestAPIInstantTestsApi(unittest.TestCase): + """APIInstantTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = APIInstantTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_api_instant_test_models_validation(self) -> None: + """Test case for create_api_instant_test request and response models""" + request_body_json = """ + { + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "credentials" : [ "3247", "1051" ], + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "requests" : [ { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + }, { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + } ], + "type" : "api", + "protocol" : "tcp", + "collectProxyNetworkData" : false, + "followRedirects" : true, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "overrideAgentProxy" : false, + "predefinedVariables" : [ { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + }, { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + } ], + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "timeLimit" : 19, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "overrideProxyId" : "281474976710706", + "sslVersionId" : "0", + "targetTime" : 1 + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.instant_tests.models.ApiInstantTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "credentials" : [ "3247", "1051" ], + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "requests" : [ { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + }, { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + } ], + "type" : "api", + "protocol" : "tcp", + "collectProxyNetworkData" : false, + "followRedirects" : true, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "overrideAgentProxy" : false, + "predefinedVariables" : [ { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + }, { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + } ], + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "timeLimit" : 19, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "overrideProxyId" : "281474976710706", + "sslVersionId" : "0", + "targetTime" : 1 + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.instant_tests.models.ApiInstantTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-instant-tests/test/test_dns_server_instant_tests_api.py b/thousandeyes-sdk-instant-tests/test/test_dns_server_instant_tests_api.py new file mode 100644 index 000000000..368321997 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/test/test_dns_server_instant_tests_api.py @@ -0,0 +1,189 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.instant_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.instant_tests.api.dns_server_instant_tests_api import DNSServerInstantTestsApi + + +class TestDNSServerInstantTestsApi(unittest.TestCase): + """DNSServerInstantTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSServerInstantTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_dns_server_instant_test_models_validation(self) -> None: + """Test case for create_dns_server_instant_test request and response models""" + request_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "probeMode" : "auto", + "type" : "dns-server", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "dnsServers" : [ "dns-example.net", "8.8.8.8" ], + "recursiveQueries" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "dnsQueryClass" : "in", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.instant_tests.models.DnsServerInstantTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "probeMode" : "auto", + "type" : "dns-server", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "dnsServers" : [ { + "serverName" : "dns-example.net", + "serverId" : "1447" + }, { + "serverName" : "dns-example.net", + "serverId" : "1447" + } ], + "recursiveQueries" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "dnsQueryClass" : "in", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.instant_tests.models.DnsServerInstantTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-instant-tests/test/test_dns_trace_instant_tests_api.py b/thousandeyes-sdk-instant-tests/test/test_dns_trace_instant_tests_api.py new file mode 100644 index 000000000..875df4f39 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/test/test_dns_trace_instant_tests_api.py @@ -0,0 +1,161 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.instant_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.instant_tests.api.dns_trace_instant_tests_api import DNSTraceInstantTestsApi + + +class TestDNSTraceInstantTestsApi(unittest.TestCase): + """DNSTraceInstantTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSTraceInstantTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_dns_trace_instant_test_models_validation(self) -> None: + """Test case for create_dns_trace_instant_test request and response models""" + request_body_json = """ + { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "type" : "dns-trace", + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "testName" : "ThousandEyes Test" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.instant_tests.models.DnsTraceInstantTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "type" : "dns-trace", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "testName" : "ThousandEyes Test" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.instant_tests.models.DnsTraceInstantTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-instant-tests/test/test_dnssec_instant_tests_api.py b/thousandeyes-sdk-instant-tests/test/test_dnssec_instant_tests_api.py new file mode 100644 index 000000000..1ade46b9e --- /dev/null +++ b/thousandeyes-sdk-instant-tests/test/test_dnssec_instant_tests_api.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.instant_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.instant_tests.api.dnssec_instant_tests_api import DNSSECInstantTestsApi + + +class TestDNSSECInstantTestsApi(unittest.TestCase): + """DNSSECInstantTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSSECInstantTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_dns_sec_instant_test_models_validation(self) -> None: + """Test case for create_dns_sec_instant_test request and response models""" + request_body_json = """ + { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "dnssec", + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "testName" : "ThousandEyes Test" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.instant_tests.models.DnsSecInstantTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "dnssec", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "testName" : "ThousandEyes Test" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.instant_tests.models.DnsSecInstantTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-instant-tests/test/test_ftp_server_instant_tests_api.py b/thousandeyes-sdk-instant-tests/test/test_ftp_server_instant_tests_api.py new file mode 100644 index 000000000..338e0b8b2 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/test/test_ftp_server_instant_tests_api.py @@ -0,0 +1,191 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.instant_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.instant_tests.api.ftp_server_instant_tests_api import FTPServerInstantTestsApi + + +class TestFTPServerInstantTestsApi(unittest.TestCase): + """FTPServerInstantTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = FTPServerInstantTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_ftp_server_instant_test_models_validation(self) -> None: + """Test case for create_ftp_server_instant_test request and response models""" + request_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "downloadLimit" : 1048576, + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "useExplicitFtps" : false, + "probeMode" : "auto", + "type" : "ftp-server", + "password" : "password", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "ftpTargetTime" : 1400, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "requestType" : "download", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "ftpTimeLimit" : 10, + "modifiedDate" : "2022-07-17T22:00:54Z", + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "useActiveFtp" : false, + "username" : "username" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.instant_tests.models.FtpServerInstantTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "downloadLimit" : 1048576, + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "useExplicitFtps" : false, + "probeMode" : "auto", + "type" : "ftp-server", + "password" : "password", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "ftpTargetTime" : 1400, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "requestType" : "download", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "ftpTimeLimit" : 10, + "modifiedDate" : "2022-07-17T22:00:54Z", + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "useActiveFtp" : false, + "username" : "username" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.instant_tests.models.FtpServerInstantTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-instant-tests/test/test_http_page_load_instant_tests_api.py b/thousandeyes-sdk-instant-tests/test/test_http_page_load_instant_tests_api.py new file mode 100644 index 000000000..c4a5d4d5b --- /dev/null +++ b/thousandeyes-sdk-instant-tests/test/test_http_page_load_instant_tests_api.py @@ -0,0 +1,289 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.instant_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.instant_tests.api.http_page_load_instant_tests_api import HTTPPageLoadInstantTestsApi + + +class TestHTTPPageLoadInstantTestsApi(unittest.TestCase): + """HTTPPageLoadInstantTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = HTTPPageLoadInstantTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_page_load_instant_test_models_validation(self) -> None: + """Test case for create_page_load_instant_test request and response models""" + request_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "page-load", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ "9842", "1283" ], + "modifiedDate" : "2022-07-17T22:00:54Z", + "emulatedDeviceId" : "2", + "sharedWithAccounts" : [ "1234", "12345" ], + "overrideProxyId" : "281474976710706", + "sslVersion" : "Auto", + "useNtlm" : false, + "downloadLimit" : 2048, + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "pageLoadTargetTime" : 10, + "numPathTraces" : 3, + "savedEvent" : true, + "userAgent" : "curl", + "pageLoadTimeLimit" : 10, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.instant_tests.models.PageLoadInstantTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "page-load", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "modifiedDate" : "2022-07-17T22:00:54Z", + "emulatedDeviceId" : "2", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "overrideProxyId" : "281474976710706", + "sslVersion" : "Auto", + "useNtlm" : false, + "downloadLimit" : 2048, + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "pageLoadTargetTime" : 10, + "numPathTraces" : 3, + "savedEvent" : true, + "userAgent" : "curl", + "pageLoadTimeLimit" : 10, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.instant_tests.models.PageLoadInstantTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-instant-tests/test/test_http_server_instant_tests_api.py b/thousandeyes-sdk-instant-tests/test/test_http_server_instant_tests_api.py new file mode 100644 index 000000000..2f39dfe3d --- /dev/null +++ b/thousandeyes-sdk-instant-tests/test/test_http_server_instant_tests_api.py @@ -0,0 +1,277 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.instant_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.instant_tests.api.http_server_instant_tests_api import HTTPServerInstantTestsApi + + +class TestHTTPServerInstantTestsApi(unittest.TestCase): + """HTTPServerInstantTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = HTTPServerInstantTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_http_server_instant_test_models_validation(self) -> None: + """Test case for create_http_server_instant_test request and response models""" + request_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "http-server", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "testName" : "ThousandEyes Test", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ "9842", "1283" ], + "modifiedDate" : "2022-07-17T22:00:54Z", + "sharedWithAccounts" : [ "1234", "12345" ], + "overrideProxyId" : "281474976710706", + "sslVersion" : "Auto", + "useNtlm" : false, + "ipv6Policy" : "use-agent-policy", + "downloadLimit" : 2048, + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "headers" : [ "header1: value1", "header2: value2" ], + "numPathTraces" : 3, + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "postBody" : "{ \\"example\\" : \\"value\\"}", + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.instant_tests.models.HttpServerInstantTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "http-server", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "testName" : "ThousandEyes Test", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "modifiedDate" : "2022-07-17T22:00:54Z", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "overrideProxyId" : "281474976710706", + "sslVersion" : "Auto", + "useNtlm" : false, + "ipv6Policy" : "use-agent-policy", + "downloadLimit" : 2048, + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "headers" : [ "header1: value1", "header2: value2" ], + "numPathTraces" : 3, + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "postBody" : "{ \\"example\\" : \\"value\\"}", + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.instant_tests.models.HttpServerInstantTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-instant-tests/test/test_instant_tests_api.py b/thousandeyes-sdk-instant-tests/test/test_instant_tests_api.py new file mode 100644 index 000000000..96a85be0d --- /dev/null +++ b/thousandeyes-sdk-instant-tests/test/test_instant_tests_api.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.instant_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.instant_tests.api.instant_tests_api import InstantTestsApi + + +class TestInstantTestsApi(unittest.TestCase): + """InstantTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = InstantTestsApi() + + def tearDown(self) -> None: + pass + + def test_run_instant_test_models_validation(self) -> None: + """Test case for run_instant_test request and response models""" + + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-instant-tests/test/test_sip_server_instant_tests_api.py b/thousandeyes-sdk-instant-tests/test/test_sip_server_instant_tests_api.py new file mode 100644 index 000000000..3f99218b9 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/test/test_sip_server_instant_tests_api.py @@ -0,0 +1,191 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.instant_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.instant_tests.api.sip_server_instant_tests_api import SIPServerInstantTestsApi + + +class TestSIPServerInstantTestsApi(unittest.TestCase): + """SIPServerInstantTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = SIPServerInstantTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_sip_server_instant_test_models_validation(self) -> None: + """Test case for create_sip_server_instant_test request and response models""" + request_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "registerEnabled" : false, + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "sip-server", + "fixedPacketRate" : 50, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "targetSipCredentials" : { + "password" : "password", + "protocol" : "tcp", + "port" : 49153, + "sipRegistrar" : "voice.thousandeyes.com", + "authUser" : "username", + "user" : "username" + }, + "testName" : "ThousandEyes Test", + "sipTargetTime" : 1000, + "numPathTraces" : 3, + "optionsRegex" : "[\\"a-z\\"]", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "sipTimeLimit" : 5, + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.instant_tests.models.SipServerInstantTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "registerEnabled" : false, + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "sip-server", + "authUser" : "username", + "fixedPacketRate" : 50, + "password" : "password", + "protocol" : "tcp", + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "testName" : "ThousandEyes Test", + "sipTargetTime" : 1000, + "numPathTraces" : 3, + "optionsRegex" : "[\\"a-z\\"]", + "liveShare" : false, + "savedEvent" : true, + "sipRegistrar" : "voice.thousandeyes.com", + "networkMeasurements" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "sipTimeLimit" : 5, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "user" : "username" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.instant_tests.models.SipServerInstantTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-instant-tests/test/test_voice_instant_tests_api.py b/thousandeyes-sdk-instant-tests/test/test_voice_instant_tests_api.py new file mode 100644 index 000000000..c51896442 --- /dev/null +++ b/thousandeyes-sdk-instant-tests/test/test_voice_instant_tests_api.py @@ -0,0 +1,173 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.instant_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.instant_tests.api.voice_instant_tests_api import VoiceInstantTestsApi + + +class TestVoiceInstantTestsApi(unittest.TestCase): + """VoiceInstantTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = VoiceInstantTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_voice_instant_test_models_validation(self) -> None: + """Test case for create_voice_instant_test request and response models""" + request_body_json = """ + { + "numPathTraces" : 3, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "voice", + "jitterBuffer" : 40, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "dscpId" : "0", + "duration" : 5, + "codec" : "G.711 @ 64 Kbps", + "codecId" : "0", + "createdDate" : "2022-07-17T22:00:54Z", + "dscp" : "Best Effort (DSCP 0)", + "createdBy" : "user@user.com", + "port" : 1024, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "281474976710706", + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "testName" : "ThousandEyes Test" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.instant_tests.models.VoiceInstantTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "numPathTraces" : 3, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "voice", + "jitterBuffer" : 40, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "dscpId" : "0", + "duration" : 5, + "codec" : "G.711 @ 64 Kbps", + "codecId" : "0", + "createdDate" : "2022-07-17T22:00:54Z", + "dscp" : "Best Effort (DSCP 0)", + "createdBy" : "user@user.com", + "port" : 1024, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "281474976710706", + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "testName" : "ThousandEyes Test" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.instant_tests.models.VoiceInstantTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-instant-tests/test/test_web_transaction_instant_tests_api.py b/thousandeyes-sdk-instant-tests/test/test_web_transaction_instant_tests_api.py new file mode 100644 index 000000000..b449c2d0a --- /dev/null +++ b/thousandeyes-sdk-instant-tests/test/test_web_transaction_instant_tests_api.py @@ -0,0 +1,293 @@ +# coding: utf-8 + +""" + Instant Tests API + + The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.instant_tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.instant_tests.api.web_transaction_instant_tests_api import WebTransactionInstantTestsApi + + +class TestWebTransactionInstantTestsApi(unittest.TestCase): + """WebTransactionInstantTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = WebTransactionInstantTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_web_transaction_instant_test_models_validation(self) -> None: + """Test case for create_web_transaction_instant_test request and response models""" + request_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "web-transactions", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ "9842", "1283" ], + "modifiedDate" : "2022-07-17T22:00:54Z", + "emulatedDeviceId" : "2", + "sharedWithAccounts" : [ "1234", "12345" ], + "overrideProxyId" : "281474976710706", + "sslVersion" : "Auto", + "useNtlm" : false, + "credentials" : [ "3247", "1051" ], + "downloadLimit" : 2048, + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "numPathTraces" : 3, + "transactionScript" : "if (true) { return true; }", + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "timeLimit" : 30, + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username", + "targetTime" : 1 + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.instant_tests.models.WebTransactionInstantTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "web-transactions", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "modifiedDate" : "2022-07-17T22:00:54Z", + "emulatedDeviceId" : "2", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "overrideProxyId" : "281474976710706", + "sslVersion" : "Auto", + "useNtlm" : false, + "credentials" : [ "3247", "1051" ], + "downloadLimit" : 2048, + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "numPathTraces" : 3, + "transactionScript" : "if (true) { return true; }", + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "timeLimit" : 30, + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username", + "targetTime" : 1 + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.instant_tests.models.WebTransactionInstantTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-internet-insights/.openapi-generator/FILES b/thousandeyes-sdk-internet-insights/.openapi-generator/FILES index a51a2f80d..465fddf71 100644 --- a/thousandeyes-sdk-internet-insights/.openapi-generator/FILES +++ b/thousandeyes-sdk-internet-insights/.openapi-generator/FILES @@ -1,8 +1,6 @@ .openapi-generator-ignore MANIFEST.in README.md -docs/ApiAffectedAgent.md -docs/ApiAffectedTest.md docs/ApiApplicationOutageAffectedLocation.md docs/ApiApplicationOutageAffectedServer.md docs/ApiApplicationOutageDetails.md @@ -16,11 +14,13 @@ docs/ApiNetworkOutageDetails.md docs/ApiOutage.md docs/ApiOutageFilter.md docs/ApiOutagesResponse.md -docs/CatalogProvidersApi.md docs/Error.md +docs/InternetInsightsApiAffectedAgent.md +docs/InternetInsightsApiAffectedTest.md +docs/InternetInsightsCatalogProvidersApi.md +docs/InternetInsightsOutagesApi.md docs/Link.md docs/OutageScope.md -docs/OutagesAPIPublicApi.md docs/ProviderLocation.md docs/SelfLinks.md docs/UnauthorizedError.md @@ -30,11 +30,9 @@ pyproject.toml setup.cfg src/thousandeyes_sdk/internet_insights/__init__.py src/thousandeyes_sdk/internet_insights/api/__init__.py -src/thousandeyes_sdk/internet_insights/api/catalog_providers_api.py -src/thousandeyes_sdk/internet_insights/api/outages_api_public_api.py +src/thousandeyes_sdk/internet_insights/api/internet_insights_catalog_providers_api.py +src/thousandeyes_sdk/internet_insights/api/internet_insights_outages_api.py src/thousandeyes_sdk/internet_insights/models/__init__.py -src/thousandeyes_sdk/internet_insights/models/api_affected_agent.py -src/thousandeyes_sdk/internet_insights/models/api_affected_test.py src/thousandeyes_sdk/internet_insights/models/api_application_outage_affected_location.py src/thousandeyes_sdk/internet_insights/models/api_application_outage_affected_server.py src/thousandeyes_sdk/internet_insights/models/api_application_outage_details.py @@ -49,6 +47,8 @@ src/thousandeyes_sdk/internet_insights/models/api_outage.py src/thousandeyes_sdk/internet_insights/models/api_outage_filter.py src/thousandeyes_sdk/internet_insights/models/api_outages_response.py src/thousandeyes_sdk/internet_insights/models/error.py +src/thousandeyes_sdk/internet_insights/models/internet_insights_api_affected_agent.py +src/thousandeyes_sdk/internet_insights/models/internet_insights_api_affected_test.py src/thousandeyes_sdk/internet_insights/models/link.py src/thousandeyes_sdk/internet_insights/models/outage_scope.py src/thousandeyes_sdk/internet_insights/models/provider_location.py @@ -58,6 +58,6 @@ src/thousandeyes_sdk/internet_insights/models/validation_error.py src/thousandeyes_sdk/internet_insights/models/validation_error_item.py src/thousandeyes_sdk/internet_insights/py.typed test/__init__.py -test/test_catalog_providers_api.py -test/test_outages_api_public_api.py +test/test_internet_insights_catalog_providers_api.py +test/test_internet_insights_outages_api.py test/test_utils.py diff --git a/thousandeyes-sdk-internet-insights/README.md b/thousandeyes-sdk-internet-insights/README.md index cdd3ef20e..61f246c08 100644 --- a/thousandeyes-sdk-internet-insights/README.md +++ b/thousandeyes-sdk-internet-insights/README.md @@ -14,7 +14,7 @@ For more information about Internet Insights, see the [Internet Insights](https: This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -86,17 +86,17 @@ configuration = thousandeyes_sdk.core.Configuration( # Enter a context with an instance of the API client with thousandeyes_sdk.core.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.internet_insights.CatalogProvidersApi(api_client) + api_instance = thousandeyes_sdk.internet_insights.InternetInsightsCatalogProvidersApi(api_client) api_catalog_provider_filter = thousandeyes_sdk.internet_insights.ApiCatalogProviderFilter() # ApiCatalogProviderFilter | aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) try: # List catalog providers api_response = api_instance.filter_catalog_providers(api_catalog_provider_filter, aid=aid) - print("The response of CatalogProvidersApi->filter_catalog_providers:\n") + print("The response of InternetInsightsCatalogProvidersApi->filter_catalog_providers:\n") pprint(api_response) except ApiException as e: - print("Exception when calling CatalogProvidersApi->filter_catalog_providers: %s\n" % e) + print("Exception when calling InternetInsightsCatalogProvidersApi->filter_catalog_providers: %s\n" % e) ``` @@ -106,17 +106,15 @@ All URIs are relative to *https://api.thousandeyes.com/v7* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*CatalogProvidersApi* | [**filter_catalog_providers**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/CatalogProvidersApi.md#filter_catalog_providers) | **POST** /internet-insights/catalog/providers/filter | List catalog providers -*CatalogProvidersApi* | [**get_catalog_provider**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/CatalogProvidersApi.md#get_catalog_provider) | **GET** /internet-insights/catalog/providers/{providerId} | Retrieve a catalog provider -*OutagesAPIPublicApi* | [**filter_outages**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/OutagesAPIPublicApi.md#filter_outages) | **POST** /internet-insights/outages/filter | List network and application outages -*OutagesAPIPublicApi* | [**get_app_outage**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/OutagesAPIPublicApi.md#get_app_outage) | **GET** /internet-insights/outages/app/{outageId} | Retrieve application outage -*OutagesAPIPublicApi* | [**get_network_outage**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/OutagesAPIPublicApi.md#get_network_outage) | **GET** /internet-insights/outages/net/{outageId} | Retrieve network outage +*InternetInsightsCatalogProvidersApi* | [**filter_catalog_providers**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/InternetInsightsCatalogProvidersApi.md#filter_catalog_providers) | **POST** /internet-insights/catalog/providers/filter | List catalog providers +*InternetInsightsCatalogProvidersApi* | [**get_catalog_provider**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/InternetInsightsCatalogProvidersApi.md#get_catalog_provider) | **GET** /internet-insights/catalog/providers/{providerId} | Retrieve a catalog provider +*InternetInsightsOutagesApi* | [**filter_outages**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/InternetInsightsOutagesApi.md#filter_outages) | **POST** /internet-insights/outages/filter | List network and application outages +*InternetInsightsOutagesApi* | [**get_app_outage**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/InternetInsightsOutagesApi.md#get_app_outage) | **GET** /internet-insights/outages/app/{outageId} | Retrieve application outage +*InternetInsightsOutagesApi* | [**get_network_outage**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/InternetInsightsOutagesApi.md#get_network_outage) | **GET** /internet-insights/outages/net/{outageId} | Retrieve network outage ## Documentation For Models - - [ApiAffectedAgent](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/ApiAffectedAgent.md) - - [ApiAffectedTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/ApiAffectedTest.md) - [ApiApplicationOutageAffectedLocation](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/ApiApplicationOutageAffectedLocation.md) - [ApiApplicationOutageAffectedServer](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/ApiApplicationOutageAffectedServer.md) - [ApiApplicationOutageDetails](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/ApiApplicationOutageDetails.md) @@ -131,6 +129,8 @@ Class | Method | HTTP request | Description - [ApiOutageFilter](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/ApiOutageFilter.md) - [ApiOutagesResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/ApiOutagesResponse.md) - [Error](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/Error.md) + - [InternetInsightsApiAffectedAgent](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/InternetInsightsApiAffectedAgent.md) + - [InternetInsightsApiAffectedTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/InternetInsightsApiAffectedTest.md) - [Link](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/Link.md) - [OutageScope](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/OutageScope.md) - [ProviderLocation](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-internet-insights/docs/ProviderLocation.md) diff --git a/thousandeyes-sdk-internet-insights/docs/ApiApplicationOutageDetails.md b/thousandeyes-sdk-internet-insights/docs/ApiApplicationOutageDetails.md index 9403550f4..a8d90197e 100644 --- a/thousandeyes-sdk-internet-insights/docs/ApiApplicationOutageDetails.md +++ b/thousandeyes-sdk-internet-insights/docs/ApiApplicationOutageDetails.md @@ -14,9 +14,9 @@ Name | Type | Description | Notes **end_date** | **str** | Date and time when the outage ended. | [optional] **end_round_id** | **int** | Epoch time (seconds) when the outage ended. | [optional] **duration** | **int** | Duration of the outage in seconds. | [optional] -**affected_tests** | [**List[ApiAffectedTest]**](ApiAffectedTest.md) | List of affected tests. | [optional] +**affected_tests** | [**List[InternetInsightsApiAffectedTest]**](InternetInsightsApiAffectedTest.md) | List of affected tests. | [optional] **affected_domains** | **List[str]** | List of affected domains. | [optional] -**affected_agents** | [**List[ApiAffectedAgent]**](ApiAffectedAgent.md) | List of affected agents. | [optional] +**affected_agents** | [**List[InternetInsightsApiAffectedAgent]**](InternetInsightsApiAffectedAgent.md) | List of affected agents. | [optional] **errors** | **List[str]** | List of errors. | [optional] **affected_locations** | [**List[ApiApplicationOutageAffectedLocation]**](ApiApplicationOutageAffectedLocation.md) | List of affected locations. | [optional] **links** | [**SelfLinks**](SelfLinks.md) | | [optional] diff --git a/thousandeyes-sdk-internet-insights/docs/ApiNetworkOutageDetails.md b/thousandeyes-sdk-internet-insights/docs/ApiNetworkOutageDetails.md index 909f6c09b..77ce892f0 100644 --- a/thousandeyes-sdk-internet-insights/docs/ApiNetworkOutageDetails.md +++ b/thousandeyes-sdk-internet-insights/docs/ApiNetworkOutageDetails.md @@ -15,9 +15,9 @@ Name | Type | Description | Notes **end_date** | **str** | Date and time when the outage ended. | [optional] **end_round_id** | **int** | Epoch time (seconds) when the outage ended. | [optional] **duration** | **int** | Duration of the outage in seconds. | [optional] -**affected_tests** | [**List[ApiAffectedTest]**](ApiAffectedTest.md) | List of affected tests. | [optional] +**affected_tests** | [**List[InternetInsightsApiAffectedTest]**](InternetInsightsApiAffectedTest.md) | List of affected tests. | [optional] **affected_domains** | **List[str]** | List of affected domains. | [optional] -**affected_agents** | [**List[ApiAffectedAgent]**](ApiAffectedAgent.md) | List of affected agents. | [optional] +**affected_agents** | [**List[InternetInsightsApiAffectedAgent]**](InternetInsightsApiAffectedAgent.md) | List of affected agents. | [optional] **affected_locations** | [**List[ApiNetworkOutageAffectedLocation]**](ApiNetworkOutageAffectedLocation.md) | List of affected locations. | [optional] **links** | [**SelfLinks**](SelfLinks.md) | | [optional] diff --git a/thousandeyes-sdk-internet-insights/docs/InternetInsightsApiAffectedAgent.md b/thousandeyes-sdk-internet-insights/docs/InternetInsightsApiAffectedAgent.md new file mode 100644 index 000000000..aa953278e --- /dev/null +++ b/thousandeyes-sdk-internet-insights/docs/InternetInsightsApiAffectedAgent.md @@ -0,0 +1,30 @@ +# InternetInsightsApiAffectedAgent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] + +## Example + +```python +from thousandeyes_sdk.internet_insights.models.internet_insights_api_affected_agent import InternetInsightsApiAffectedAgent + +# TODO update the JSON string below +json = "{}" +# create an instance of InternetInsightsApiAffectedAgent from a JSON string +internet_insights_api_affected_agent_instance = InternetInsightsApiAffectedAgent.from_json(json) +# print the JSON string representation of the object +print(InternetInsightsApiAffectedAgent.to_json()) + +# convert the object into a dict +internet_insights_api_affected_agent_dict = internet_insights_api_affected_agent_instance.to_dict() +# create an instance of InternetInsightsApiAffectedAgent from a dict +internet_insights_api_affected_agent_from_dict = InternetInsightsApiAffectedAgent.from_dict(internet_insights_api_affected_agent_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-internet-insights/docs/InternetInsightsApiAffectedTest.md b/thousandeyes-sdk-internet-insights/docs/InternetInsightsApiAffectedTest.md new file mode 100644 index 000000000..8d05a8d19 --- /dev/null +++ b/thousandeyes-sdk-internet-insights/docs/InternetInsightsApiAffectedTest.md @@ -0,0 +1,30 @@ +# InternetInsightsApiAffectedTest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] + +## Example + +```python +from thousandeyes_sdk.internet_insights.models.internet_insights_api_affected_test import InternetInsightsApiAffectedTest + +# TODO update the JSON string below +json = "{}" +# create an instance of InternetInsightsApiAffectedTest from a JSON string +internet_insights_api_affected_test_instance = InternetInsightsApiAffectedTest.from_json(json) +# print the JSON string representation of the object +print(InternetInsightsApiAffectedTest.to_json()) + +# convert the object into a dict +internet_insights_api_affected_test_dict = internet_insights_api_affected_test_instance.to_dict() +# create an instance of InternetInsightsApiAffectedTest from a dict +internet_insights_api_affected_test_from_dict = InternetInsightsApiAffectedTest.from_dict(internet_insights_api_affected_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-internet-insights/docs/InternetInsightsCatalogProvidersApi.md b/thousandeyes-sdk-internet-insights/docs/InternetInsightsCatalogProvidersApi.md new file mode 100644 index 000000000..5b51bf620 --- /dev/null +++ b/thousandeyes-sdk-internet-insights/docs/InternetInsightsCatalogProvidersApi.md @@ -0,0 +1,187 @@ +# thousandeyes_sdk.internet_insights.InternetInsightsCatalogProvidersApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**filter_catalog_providers**](InternetInsightsCatalogProvidersApi.md#filter_catalog_providers) | **POST** /internet-insights/catalog/providers/filter | List catalog providers +[**get_catalog_provider**](InternetInsightsCatalogProvidersApi.md#get_catalog_provider) | **GET** /internet-insights/catalog/providers/{providerId} | Retrieve a catalog provider + + +# **filter_catalog_providers** +> ApiCatalogProviderResponse filter_catalog_providers(api_catalog_provider_filter, aid=aid) + +List catalog providers + +Returns a list of catalog providers using the specified filters. Returns high-level information about each catalog provider. For more details about a specific provider, call the Get a catalog provider endpoint. Note: Support for pagination will be added in the future. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.internet_insights +from thousandeyes_sdk.internet_insights.models.api_catalog_provider_filter import ApiCatalogProviderFilter +from thousandeyes_sdk.internet_insights.models.api_catalog_provider_response import ApiCatalogProviderResponse +from thousandeyes_sdk.internet_insights.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.internet_insights.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.internet_insights.InternetInsightsCatalogProvidersApi(api_client) + api_catalog_provider_filter = thousandeyes_sdk.internet_insights.ApiCatalogProviderFilter() # ApiCatalogProviderFilter | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List catalog providers + api_response = api_instance.filter_catalog_providers(api_catalog_provider_filter, aid=aid) + print("The response of InternetInsightsCatalogProvidersApi->filter_catalog_providers:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InternetInsightsCatalogProvidersApi->filter_catalog_providers: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **api_catalog_provider_filter** | [**ApiCatalogProviderFilter**](ApiCatalogProviderFilter.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ApiCatalogProviderResponse**](ApiCatalogProviderResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_catalog_provider** +> ApiCatalogProviderDetails get_catalog_provider(provider_id, aid=aid) + +Retrieve a catalog provider + +Returns the details of a catalog provider. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.internet_insights +from thousandeyes_sdk.internet_insights.models.api_catalog_provider_details import ApiCatalogProviderDetails +from thousandeyes_sdk.internet_insights.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.internet_insights.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.internet_insights.InternetInsightsCatalogProvidersApi(api_client) + provider_id = '85602a0a-54a7-4e97-946e-67492ef1fa26' # str | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Retrieve a catalog provider + api_response = api_instance.get_catalog_provider(provider_id, aid=aid) + print("The response of InternetInsightsCatalogProvidersApi->get_catalog_provider:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InternetInsightsCatalogProvidersApi->get_catalog_provider: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ApiCatalogProviderDetails**](ApiCatalogProviderDetails.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-internet-insights/docs/InternetInsightsOutagesApi.md b/thousandeyes-sdk-internet-insights/docs/InternetInsightsOutagesApi.md new file mode 100644 index 000000000..6908fbe3d --- /dev/null +++ b/thousandeyes-sdk-internet-insights/docs/InternetInsightsOutagesApi.md @@ -0,0 +1,276 @@ +# thousandeyes_sdk.internet_insights.InternetInsightsOutagesApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**filter_outages**](InternetInsightsOutagesApi.md#filter_outages) | **POST** /internet-insights/outages/filter | List network and application outages +[**get_app_outage**](InternetInsightsOutagesApi.md#get_app_outage) | **GET** /internet-insights/outages/app/{outageId} | Retrieve application outage +[**get_network_outage**](InternetInsightsOutagesApi.md#get_network_outage) | **GET** /internet-insights/outages/net/{outageId} | Retrieve network outage + + +# **filter_outages** +> ApiOutagesResponse filter_outages(api_outage_filter, aid=aid) + +List network and application outages + +Returns a list of network and application outages using a filter object. Advanced Filter persistance is not currently supported. Note: Support for pagination will be added in the future. ## Samples Queries with Different Filter Permutations ### Window ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token --header 'Accept-Encoding: application/gzip' --header 'Content-Type: application/json' --data-raw '{ \"window\" : \"1d\" }' ``` ### Date Range ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\" }' ``` ### Date Range with Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"outageScope\": \"with-affected-test\" }' ``` ### Date Range with Network ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"interfaceNetwork\": [\"Telianet\"] }' ``` ### Date Range with Application ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"applicationName\": [\"Google\"] }' ``` ### Date Range with Provider ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"providerName\": [\"Century Link\", \"Microsoft\"] }' ``` ### Date Range with Application and Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"outageScope\": \"all\", \"applicationName\": [\"Google\"] }' ``` + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.internet_insights +from thousandeyes_sdk.internet_insights.models.api_outage_filter import ApiOutageFilter +from thousandeyes_sdk.internet_insights.models.api_outages_response import ApiOutagesResponse +from thousandeyes_sdk.internet_insights.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.internet_insights.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.internet_insights.InternetInsightsOutagesApi(api_client) + api_outage_filter = thousandeyes_sdk.internet_insights.ApiOutageFilter() # ApiOutageFilter | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List network and application outages + api_response = api_instance.filter_outages(api_outage_filter, aid=aid) + print("The response of InternetInsightsOutagesApi->filter_outages:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InternetInsightsOutagesApi->filter_outages: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **api_outage_filter** | [**ApiOutageFilter**](ApiOutageFilter.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ApiOutagesResponse**](ApiOutagesResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_app_outage** +> ApiApplicationOutageDetails get_app_outage(outage_id, aid=aid) + +Retrieve application outage + +Returns the details of an application outage. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.internet_insights +from thousandeyes_sdk.internet_insights.models.api_application_outage_details import ApiApplicationOutageDetails +from thousandeyes_sdk.internet_insights.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.internet_insights.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.internet_insights.InternetInsightsOutagesApi(api_client) + outage_id = 'F73E24F17E4996923196826A208BB572508A8EB13BEE14B0' # str | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Retrieve application outage + api_response = api_instance.get_app_outage(outage_id, aid=aid) + print("The response of InternetInsightsOutagesApi->get_app_outage:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InternetInsightsOutagesApi->get_app_outage: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outage_id** | **str**| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ApiApplicationOutageDetails**](ApiApplicationOutageDetails.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_network_outage** +> ApiNetworkOutageDetails get_network_outage(outage_id, aid=aid) + +Retrieve network outage + +Returns the details of a network outage. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.internet_insights +from thousandeyes_sdk.internet_insights.models.api_network_outage_details import ApiNetworkOutageDetails +from thousandeyes_sdk.internet_insights.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.internet_insights.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.internet_insights.InternetInsightsOutagesApi(api_client) + outage_id = '694D8656960F34F76489BCE5E9BCD58EC53027462740D75F' # str | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Retrieve network outage + api_response = api_instance.get_network_outage(outage_id, aid=aid) + print("The response of InternetInsightsOutagesApi->get_network_outage:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InternetInsightsOutagesApi->get_network_outage: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outage_id** | **str**| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ApiNetworkOutageDetails**](ApiNetworkOutageDetails.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/__init__.py b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/__init__.py index df887f52d..1485d77ea 100644 --- a/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/__init__.py +++ b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/__init__.py @@ -14,13 +14,11 @@ # import apis into sdk package -from thousandeyes_sdk.internet_insights.api.catalog_providers_api import CatalogProvidersApi -from thousandeyes_sdk.internet_insights.api.outages_api_public_api import OutagesAPIPublicApi +from thousandeyes_sdk.internet_insights.api.internet_insights_catalog_providers_api import InternetInsightsCatalogProvidersApi +from thousandeyes_sdk.internet_insights.api.internet_insights_outages_api import InternetInsightsOutagesApi # import models into sdk package -from thousandeyes_sdk.internet_insights.models.api_affected_agent import ApiAffectedAgent -from thousandeyes_sdk.internet_insights.models.api_affected_test import ApiAffectedTest from thousandeyes_sdk.internet_insights.models.api_application_outage_affected_location import ApiApplicationOutageAffectedLocation from thousandeyes_sdk.internet_insights.models.api_application_outage_affected_server import ApiApplicationOutageAffectedServer from thousandeyes_sdk.internet_insights.models.api_application_outage_details import ApiApplicationOutageDetails @@ -35,6 +33,8 @@ from thousandeyes_sdk.internet_insights.models.api_outage_filter import ApiOutageFilter from thousandeyes_sdk.internet_insights.models.api_outages_response import ApiOutagesResponse from thousandeyes_sdk.internet_insights.models.error import Error +from thousandeyes_sdk.internet_insights.models.internet_insights_api_affected_agent import InternetInsightsApiAffectedAgent +from thousandeyes_sdk.internet_insights.models.internet_insights_api_affected_test import InternetInsightsApiAffectedTest from thousandeyes_sdk.internet_insights.models.link import Link from thousandeyes_sdk.internet_insights.models.outage_scope import OutageScope from thousandeyes_sdk.internet_insights.models.provider_location import ProviderLocation diff --git a/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/api/__init__.py b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/api/__init__.py index 658029d60..5d4e5e6ae 100644 --- a/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/api/__init__.py +++ b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/api/__init__.py @@ -1,6 +1,6 @@ # flake8: noqa # import apis into api package -from thousandeyes_sdk.internet_insights.api.catalog_providers_api import CatalogProvidersApi -from thousandeyes_sdk.internet_insights.api.outages_api_public_api import OutagesAPIPublicApi +from thousandeyes_sdk.internet_insights.api.internet_insights_catalog_providers_api import InternetInsightsCatalogProvidersApi +from thousandeyes_sdk.internet_insights.api.internet_insights_outages_api import InternetInsightsOutagesApi diff --git a/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/api/internet_insights_catalog_providers_api.py b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/api/internet_insights_catalog_providers_api.py new file mode 100644 index 000000000..cb169534e --- /dev/null +++ b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/api/internet_insights_catalog_providers_api.py @@ -0,0 +1,657 @@ +# coding: utf-8 + +""" + Internet Insights API + + We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. For more information about Internet Insights, see the [Internet Insights](https://docs.thousandeyes.com/product-documentation/internet-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.internet_insights.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.internet_insights.models.api_catalog_provider_details import ApiCatalogProviderDetails +from thousandeyes_sdk.internet_insights.models.api_catalog_provider_filter import ApiCatalogProviderFilter +from thousandeyes_sdk.internet_insights.models.api_catalog_provider_response import ApiCatalogProviderResponse + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class InternetInsightsCatalogProvidersApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-internet-insights")) + self.api_client = api_client + + + @validate_call + def filter_catalog_providers( + self, + api_catalog_provider_filter: ApiCatalogProviderFilter, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiCatalogProviderResponse: + """List catalog providers + + Returns a list of catalog providers using the specified filters. Returns high-level information about each catalog provider. For more details about a specific provider, call the Get a catalog provider endpoint. Note: Support for pagination will be added in the future. + + :param api_catalog_provider_filter: (required) + :type api_catalog_provider_filter: ApiCatalogProviderFilter + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_catalog_providers_serialize( + api_catalog_provider_filter=api_catalog_provider_filter, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiCatalogProviderResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.internet_insights.models, + ).data + + + @validate_call + def filter_catalog_providers_with_http_info( + self, + api_catalog_provider_filter: ApiCatalogProviderFilter, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ApiCatalogProviderResponse]: + """List catalog providers + + Returns a list of catalog providers using the specified filters. Returns high-level information about each catalog provider. For more details about a specific provider, call the Get a catalog provider endpoint. Note: Support for pagination will be added in the future. + + :param api_catalog_provider_filter: (required) + :type api_catalog_provider_filter: ApiCatalogProviderFilter + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_catalog_providers_serialize( + api_catalog_provider_filter=api_catalog_provider_filter, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiCatalogProviderResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.internet_insights.models, + ) + + + @validate_call + def filter_catalog_providers_without_preload_content( + self, + api_catalog_provider_filter: ApiCatalogProviderFilter, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List catalog providers + + Returns a list of catalog providers using the specified filters. Returns high-level information about each catalog provider. For more details about a specific provider, call the Get a catalog provider endpoint. Note: Support for pagination will be added in the future. + + :param api_catalog_provider_filter: (required) + :type api_catalog_provider_filter: ApiCatalogProviderFilter + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_catalog_providers_serialize( + api_catalog_provider_filter=api_catalog_provider_filter, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiCatalogProviderResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _filter_catalog_providers_serialize( + self, + api_catalog_provider_filter, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if api_catalog_provider_filter is not None: + _body_params = api_catalog_provider_filter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/internet-insights/catalog/providers/filter', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_catalog_provider( + self, + provider_id: StrictStr, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiCatalogProviderDetails: + """Retrieve a catalog provider + + Returns the details of a catalog provider. + + :param provider_id: (required) + :type provider_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_catalog_provider_serialize( + provider_id=provider_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiCatalogProviderDetails", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.internet_insights.models, + ).data + + + @validate_call + def get_catalog_provider_with_http_info( + self, + provider_id: StrictStr, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ApiCatalogProviderDetails]: + """Retrieve a catalog provider + + Returns the details of a catalog provider. + + :param provider_id: (required) + :type provider_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_catalog_provider_serialize( + provider_id=provider_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiCatalogProviderDetails", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.internet_insights.models, + ) + + + @validate_call + def get_catalog_provider_without_preload_content( + self, + provider_id: StrictStr, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a catalog provider + + Returns the details of a catalog provider. + + :param provider_id: (required) + :type provider_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_catalog_provider_serialize( + provider_id=provider_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiCatalogProviderDetails", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_catalog_provider_serialize( + self, + provider_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if provider_id is not None: + _path_params['providerId'] = provider_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/internet-insights/catalog/providers/{providerId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/api/internet_insights_outages_api.py b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/api/internet_insights_outages_api.py new file mode 100644 index 000000000..177e14209 --- /dev/null +++ b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/api/internet_insights_outages_api.py @@ -0,0 +1,958 @@ +# coding: utf-8 + +""" + Internet Insights API + + We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. For more information about Internet Insights, see the [Internet Insights](https://docs.thousandeyes.com/product-documentation/internet-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.internet_insights.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.internet_insights.models.api_application_outage_details import ApiApplicationOutageDetails +from thousandeyes_sdk.internet_insights.models.api_network_outage_details import ApiNetworkOutageDetails +from thousandeyes_sdk.internet_insights.models.api_outage_filter import ApiOutageFilter +from thousandeyes_sdk.internet_insights.models.api_outages_response import ApiOutagesResponse + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class InternetInsightsOutagesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-internet-insights")) + self.api_client = api_client + + + @validate_call + def filter_outages( + self, + api_outage_filter: ApiOutageFilter, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiOutagesResponse: + """List network and application outages + + Returns a list of network and application outages using a filter object. Advanced Filter persistance is not currently supported. Note: Support for pagination will be added in the future. ## Samples Queries with Different Filter Permutations ### Window ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token --header 'Accept-Encoding: application/gzip' --header 'Content-Type: application/json' --data-raw '{ \"window\" : \"1d\" }' ``` ### Date Range ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\" }' ``` ### Date Range with Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"outageScope\": \"with-affected-test\" }' ``` ### Date Range with Network ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"interfaceNetwork\": [\"Telianet\"] }' ``` ### Date Range with Application ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"applicationName\": [\"Google\"] }' ``` ### Date Range with Provider ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"providerName\": [\"Century Link\", \"Microsoft\"] }' ``` ### Date Range with Application and Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"outageScope\": \"all\", \"applicationName\": [\"Google\"] }' ``` + + :param api_outage_filter: (required) + :type api_outage_filter: ApiOutageFilter + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_outages_serialize( + api_outage_filter=api_outage_filter, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiOutagesResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.internet_insights.models, + ).data + + + @validate_call + def filter_outages_with_http_info( + self, + api_outage_filter: ApiOutageFilter, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ApiOutagesResponse]: + """List network and application outages + + Returns a list of network and application outages using a filter object. Advanced Filter persistance is not currently supported. Note: Support for pagination will be added in the future. ## Samples Queries with Different Filter Permutations ### Window ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token --header 'Accept-Encoding: application/gzip' --header 'Content-Type: application/json' --data-raw '{ \"window\" : \"1d\" }' ``` ### Date Range ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\" }' ``` ### Date Range with Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"outageScope\": \"with-affected-test\" }' ``` ### Date Range with Network ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"interfaceNetwork\": [\"Telianet\"] }' ``` ### Date Range with Application ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"applicationName\": [\"Google\"] }' ``` ### Date Range with Provider ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"providerName\": [\"Century Link\", \"Microsoft\"] }' ``` ### Date Range with Application and Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"outageScope\": \"all\", \"applicationName\": [\"Google\"] }' ``` + + :param api_outage_filter: (required) + :type api_outage_filter: ApiOutageFilter + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_outages_serialize( + api_outage_filter=api_outage_filter, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiOutagesResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.internet_insights.models, + ) + + + @validate_call + def filter_outages_without_preload_content( + self, + api_outage_filter: ApiOutageFilter, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List network and application outages + + Returns a list of network and application outages using a filter object. Advanced Filter persistance is not currently supported. Note: Support for pagination will be added in the future. ## Samples Queries with Different Filter Permutations ### Window ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token --header 'Accept-Encoding: application/gzip' --header 'Content-Type: application/json' --data-raw '{ \"window\" : \"1d\" }' ``` ### Date Range ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\" }' ``` ### Date Range with Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"outageScope\": \"with-affected-test\" }' ``` ### Date Range with Network ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"interfaceNetwork\": [\"Telianet\"] }' ``` ### Date Range with Application ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"applicationName\": [\"Google\"] }' ``` ### Date Range with Provider ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"providerName\": [\"Century Link\", \"Microsoft\"] }' ``` ### Date Range with Application and Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{ \"startDate\": \"2022-03-01T01:30:00Z\", \"endDate\" : \"2022-03-01T23:30:15Z\", \"outageScope\": \"all\", \"applicationName\": [\"Google\"] }' ``` + + :param api_outage_filter: (required) + :type api_outage_filter: ApiOutageFilter + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._filter_outages_serialize( + api_outage_filter=api_outage_filter, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiOutagesResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _filter_outages_serialize( + self, + api_outage_filter, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if api_outage_filter is not None: + _body_params = api_outage_filter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/internet-insights/outages/filter', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_app_outage( + self, + outage_id: StrictStr, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiApplicationOutageDetails: + """Retrieve application outage + + Returns the details of an application outage. + + :param outage_id: (required) + :type outage_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_app_outage_serialize( + outage_id=outage_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiApplicationOutageDetails", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.internet_insights.models, + ).data + + + @validate_call + def get_app_outage_with_http_info( + self, + outage_id: StrictStr, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ApiApplicationOutageDetails]: + """Retrieve application outage + + Returns the details of an application outage. + + :param outage_id: (required) + :type outage_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_app_outage_serialize( + outage_id=outage_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiApplicationOutageDetails", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.internet_insights.models, + ) + + + @validate_call + def get_app_outage_without_preload_content( + self, + outage_id: StrictStr, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve application outage + + Returns the details of an application outage. + + :param outage_id: (required) + :type outage_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_app_outage_serialize( + outage_id=outage_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiApplicationOutageDetails", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_app_outage_serialize( + self, + outage_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if outage_id is not None: + _path_params['outageId'] = outage_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/internet-insights/outages/app/{outageId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_network_outage( + self, + outage_id: StrictStr, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiNetworkOutageDetails: + """Retrieve network outage + + Returns the details of a network outage. + + :param outage_id: (required) + :type outage_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_network_outage_serialize( + outage_id=outage_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiNetworkOutageDetails", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.internet_insights.models, + ).data + + + @validate_call + def get_network_outage_with_http_info( + self, + outage_id: StrictStr, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ApiNetworkOutageDetails]: + """Retrieve network outage + + Returns the details of a network outage. + + :param outage_id: (required) + :type outage_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_network_outage_serialize( + outage_id=outage_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiNetworkOutageDetails", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.internet_insights.models, + ) + + + @validate_call + def get_network_outage_without_preload_content( + self, + outage_id: StrictStr, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve network outage + + Returns the details of a network outage. + + :param outage_id: (required) + :type outage_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_network_outage_serialize( + outage_id=outage_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiNetworkOutageDetails", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_network_outage_serialize( + self, + outage_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if outage_id is not None: + _path_params['outageId'] = outage_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/internet-insights/outages/net/{outageId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/__init__.py b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/__init__.py index 21eb045e7..3f8e1e498 100644 --- a/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/__init__.py +++ b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/__init__.py @@ -13,8 +13,6 @@ # import models into model package -from thousandeyes_sdk.internet_insights.models.api_affected_agent import ApiAffectedAgent -from thousandeyes_sdk.internet_insights.models.api_affected_test import ApiAffectedTest from thousandeyes_sdk.internet_insights.models.api_application_outage_affected_location import ApiApplicationOutageAffectedLocation from thousandeyes_sdk.internet_insights.models.api_application_outage_affected_server import ApiApplicationOutageAffectedServer from thousandeyes_sdk.internet_insights.models.api_application_outage_details import ApiApplicationOutageDetails @@ -29,6 +27,8 @@ from thousandeyes_sdk.internet_insights.models.api_outage_filter import ApiOutageFilter from thousandeyes_sdk.internet_insights.models.api_outages_response import ApiOutagesResponse from thousandeyes_sdk.internet_insights.models.error import Error +from thousandeyes_sdk.internet_insights.models.internet_insights_api_affected_agent import InternetInsightsApiAffectedAgent +from thousandeyes_sdk.internet_insights.models.internet_insights_api_affected_test import InternetInsightsApiAffectedTest from thousandeyes_sdk.internet_insights.models.link import Link from thousandeyes_sdk.internet_insights.models.outage_scope import OutageScope from thousandeyes_sdk.internet_insights.models.provider_location import ProviderLocation diff --git a/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/api_application_outage_details.py b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/api_application_outage_details.py index b43df7c02..2606f432b 100644 --- a/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/api_application_outage_details.py +++ b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/api_application_outage_details.py @@ -18,9 +18,9 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.internet_insights.models.api_affected_agent import ApiAffectedAgent -from thousandeyes_sdk.internet_insights.models.api_affected_test import ApiAffectedTest from thousandeyes_sdk.internet_insights.models.api_application_outage_affected_location import ApiApplicationOutageAffectedLocation +from thousandeyes_sdk.internet_insights.models.internet_insights_api_affected_agent import InternetInsightsApiAffectedAgent +from thousandeyes_sdk.internet_insights.models.internet_insights_api_affected_test import InternetInsightsApiAffectedTest from thousandeyes_sdk.internet_insights.models.self_links import SelfLinks from typing import Optional, Set from typing_extensions import Self @@ -38,9 +38,9 @@ class ApiApplicationOutageDetails(BaseModel): end_date: Optional[StrictStr] = Field(default=None, description="Date and time when the outage ended.", alias="endDate") end_round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) when the outage ended.", alias="endRoundId") duration: Optional[StrictInt] = Field(default=None, description="Duration of the outage in seconds.") - affected_tests: Optional[List[ApiAffectedTest]] = Field(default=None, description="List of affected tests.", alias="affectedTests") + affected_tests: Optional[List[InternetInsightsApiAffectedTest]] = Field(default=None, description="List of affected tests.", alias="affectedTests") affected_domains: Optional[List[StrictStr]] = Field(default=None, description="List of affected domains.", alias="affectedDomains") - affected_agents: Optional[List[ApiAffectedAgent]] = Field(default=None, description="List of affected agents.", alias="affectedAgents") + affected_agents: Optional[List[InternetInsightsApiAffectedAgent]] = Field(default=None, description="List of affected agents.", alias="affectedAgents") errors: Optional[List[StrictStr]] = Field(default=None, description="List of errors.") affected_locations: Optional[List[ApiApplicationOutageAffectedLocation]] = Field(default=None, description="List of affected locations.", alias="affectedLocations") links: Optional[SelfLinks] = Field(default=None, alias="_links") @@ -131,9 +131,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "endDate": obj.get("endDate"), "endRoundId": obj.get("endRoundId"), "duration": obj.get("duration"), - "affectedTests": [ApiAffectedTest.from_dict(_item) for _item in obj["affectedTests"]] if obj.get("affectedTests") is not None else None, + "affectedTests": [InternetInsightsApiAffectedTest.from_dict(_item) for _item in obj["affectedTests"]] if obj.get("affectedTests") is not None else None, "affectedDomains": obj.get("affectedDomains"), - "affectedAgents": [ApiAffectedAgent.from_dict(_item) for _item in obj["affectedAgents"]] if obj.get("affectedAgents") is not None else None, + "affectedAgents": [InternetInsightsApiAffectedAgent.from_dict(_item) for _item in obj["affectedAgents"]] if obj.get("affectedAgents") is not None else None, "errors": obj.get("errors"), "affectedLocations": [ApiApplicationOutageAffectedLocation.from_dict(_item) for _item in obj["affectedLocations"]] if obj.get("affectedLocations") is not None else None, "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None diff --git a/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/api_network_outage_details.py b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/api_network_outage_details.py index 091133598..718a17065 100644 --- a/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/api_network_outage_details.py +++ b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/api_network_outage_details.py @@ -18,9 +18,9 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.internet_insights.models.api_affected_agent import ApiAffectedAgent -from thousandeyes_sdk.internet_insights.models.api_affected_test import ApiAffectedTest from thousandeyes_sdk.internet_insights.models.api_network_outage_affected_location import ApiNetworkOutageAffectedLocation +from thousandeyes_sdk.internet_insights.models.internet_insights_api_affected_agent import InternetInsightsApiAffectedAgent +from thousandeyes_sdk.internet_insights.models.internet_insights_api_affected_test import InternetInsightsApiAffectedTest from thousandeyes_sdk.internet_insights.models.self_links import SelfLinks from typing import Optional, Set from typing_extensions import Self @@ -39,9 +39,9 @@ class ApiNetworkOutageDetails(BaseModel): end_date: Optional[StrictStr] = Field(default=None, description="Date and time when the outage ended.", alias="endDate") end_round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) when the outage ended.", alias="endRoundId") duration: Optional[StrictInt] = Field(default=None, description="Duration of the outage in seconds.") - affected_tests: Optional[List[ApiAffectedTest]] = Field(default=None, description="List of affected tests.", alias="affectedTests") + affected_tests: Optional[List[InternetInsightsApiAffectedTest]] = Field(default=None, description="List of affected tests.", alias="affectedTests") affected_domains: Optional[List[StrictStr]] = Field(default=None, description="List of affected domains.", alias="affectedDomains") - affected_agents: Optional[List[ApiAffectedAgent]] = Field(default=None, description="List of affected agents.", alias="affectedAgents") + affected_agents: Optional[List[InternetInsightsApiAffectedAgent]] = Field(default=None, description="List of affected agents.", alias="affectedAgents") affected_locations: Optional[List[ApiNetworkOutageAffectedLocation]] = Field(default=None, description="List of affected locations.", alias="affectedLocations") links: Optional[SelfLinks] = Field(default=None, alias="_links") __properties: ClassVar[List[str]] = ["id", "providerName", "providerType", "networkName", "asn", "startDate", "startRoundId", "endDate", "endRoundId", "duration", "affectedTests", "affectedDomains", "affectedAgents", "affectedLocations", "_links"] @@ -132,9 +132,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "endDate": obj.get("endDate"), "endRoundId": obj.get("endRoundId"), "duration": obj.get("duration"), - "affectedTests": [ApiAffectedTest.from_dict(_item) for _item in obj["affectedTests"]] if obj.get("affectedTests") is not None else None, + "affectedTests": [InternetInsightsApiAffectedTest.from_dict(_item) for _item in obj["affectedTests"]] if obj.get("affectedTests") is not None else None, "affectedDomains": obj.get("affectedDomains"), - "affectedAgents": [ApiAffectedAgent.from_dict(_item) for _item in obj["affectedAgents"]] if obj.get("affectedAgents") is not None else None, + "affectedAgents": [InternetInsightsApiAffectedAgent.from_dict(_item) for _item in obj["affectedAgents"]] if obj.get("affectedAgents") is not None else None, "affectedLocations": [ApiNetworkOutageAffectedLocation.from_dict(_item) for _item in obj["affectedLocations"]] if obj.get("affectedLocations") is not None else None, "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None }) diff --git a/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/internet_insights_api_affected_agent.py b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/internet_insights_api_affected_agent.py new file mode 100644 index 000000000..338e9ee97 --- /dev/null +++ b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/internet_insights_api_affected_agent.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Internet Insights API + + We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. For more information about Internet Insights, see the [Internet Insights](https://docs.thousandeyes.com/product-documentation/internet-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class InternetInsightsApiAffectedAgent(BaseModel): + """ + InternetInsightsApiAffectedAgent + """ # noqa: E501 + id: Optional[StrictInt] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InternetInsightsApiAffectedAgent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InternetInsightsApiAffectedAgent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name") + }) + return _obj + + diff --git a/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/internet_insights_api_affected_test.py b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/internet_insights_api_affected_test.py new file mode 100644 index 000000000..ce4c79712 --- /dev/null +++ b/thousandeyes-sdk-internet-insights/src/thousandeyes_sdk/internet_insights/models/internet_insights_api_affected_test.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Internet Insights API + + We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. For more information about Internet Insights, see the [Internet Insights](https://docs.thousandeyes.com/product-documentation/internet-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class InternetInsightsApiAffectedTest(BaseModel): + """ + InternetInsightsApiAffectedTest + """ # noqa: E501 + id: Optional[StrictInt] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InternetInsightsApiAffectedTest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InternetInsightsApiAffectedTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name") + }) + return _obj + + diff --git a/thousandeyes-sdk-internet-insights/test/test_internet_insights_catalog_providers_api.py b/thousandeyes-sdk-internet-insights/test/test_internet_insights_catalog_providers_api.py new file mode 100644 index 000000000..d64386530 --- /dev/null +++ b/thousandeyes-sdk-internet-insights/test/test_internet_insights_catalog_providers_api.py @@ -0,0 +1,158 @@ +# coding: utf-8 + +""" + Internet Insights API + + We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. For more information about Internet Insights, see the [Internet Insights](https://docs.thousandeyes.com/product-documentation/internet-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.internet_insights.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.internet_insights.api.internet_insights_catalog_providers_api import InternetInsightsCatalogProvidersApi + + +class TestInternetInsightsCatalogProvidersApi(unittest.TestCase): + """InternetInsightsCatalogProvidersApi unit test stubs""" + + def setUp(self) -> None: + self.api = InternetInsightsCatalogProvidersApi() + + def tearDown(self) -> None: + pass + + def test_filter_catalog_providers_models_validation(self) -> None: + """Test case for filter_catalog_providers request and response models""" + request_body_json = """ + { + "providerName" : "Amazon Web Services", + "providerType" : "IAAS", + "region" : "North America", + "location" : "San Jose, US", + "asn" : "Amazon.com, Inc.", + "included" : true + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.internet_insights.models.ApiCatalogProviderFilter.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "providers" : [ { + "interfacesCount" : 15, + "locationsCount" : 50, + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "countriesCount" : 2, + "dataType" : "Application", + "id" : "85602a0a-54a7-4e97-946e-67492ef1fa26", + "region" : "North America", + "asnsCount" : 10, + "included" : true, + "providerName" : "Amazon Web Services", + "providerType" : "IAAS" + }, { + "interfacesCount" : 15, + "locationsCount" : 50, + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "countriesCount" : 2, + "dataType" : "Application", + "id" : "85602a0a-54a7-4e97-946e-67492ef1fa26", + "region" : "North America", + "asnsCount" : 10, + "included" : true, + "providerName" : "Amazon Web Services", + "providerType" : "IAAS" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.internet_insights.models.ApiCatalogProviderResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_catalog_provider_models_validation(self) -> None: + """Test case for get_catalog_provider request and response models""" + + response_body_json = """ + { + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dataType" : "Application", + "asns" : [ { + "name" : "LVLT-1 - Level 3 Communications, Inc.", + "id" : 1 + }, { + "name" : "LVLT-1 - Level 3 Communications, Inc.", + "id" : 1 + } ], + "locations" : [ { + "interfacesCount" : 5, + "location" : "San Jose, US" + }, { + "interfacesCount" : 5, + "location" : "San Jose, US" + } ], + "id" : "85602a0a-54a7-4e97-946e-67492ef1fa26", + "region" : "North America", + "providerName" : "Amazon Web Services", + "providerType" : "IAAS" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.internet_insights.models.ApiCatalogProviderDetails.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-internet-insights/test/test_internet_insights_outages_api.py b/thousandeyes-sdk-internet-insights/test/test_internet_insights_outages_api.py new file mode 100644 index 000000000..d3479114e --- /dev/null +++ b/thousandeyes-sdk-internet-insights/test/test_internet_insights_outages_api.py @@ -0,0 +1,248 @@ +# coding: utf-8 + +""" + Internet Insights API + + We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that: * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner. Internet Insights provide visibility into core Internet infrastructure, including ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others. Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows. For more information about Internet Insights, see the [Internet Insights](https://docs.thousandeyes.com/product-documentation/internet-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.internet_insights.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.internet_insights.api.internet_insights_outages_api import InternetInsightsOutagesApi + + +class TestInternetInsightsOutagesApi(unittest.TestCase): + """InternetInsightsOutagesApi unit test stubs""" + + def setUp(self) -> None: + self.api = InternetInsightsOutagesApi() + + def tearDown(self) -> None: + pass + + def test_filter_outages_models_validation(self) -> None: + """Test case for filter_outages request and response models""" + request_body_json = """ + { + "startDate" : "2022-03-01T01:30:00Z", + "endDate" : "2022-03-01T23:30:15Z", + "outageScope" : "all", + "providerName" : [ "Telia", "Amazon" ], + "interfaceNetwork" : [ "Telianet", "Cloudflare" ], + "applicationName" : [ "slack", "facebook" ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.internet_insights.models.ApiOutageFilter.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "outages" : [ { + "affectedInterfacesCount" : 1, + "endDate" : "2022-03-01T23:31:11Z", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "affectedLocationsCount" : 1, + "endRoundId" : 1646177700, + "affectedTestsCount" : 1, + "type" : "app", + "providerType" : "SAAS", + "duration" : 214, + "startRoundId" : 1646177400, + "name" : "Google", + "id" : "xxxxxxxxxxxxxxxxxx1", + "affectedServersCount" : 2, + "asn" : 19994, + "providerName" : "Google", + "startDate" : "2022-03-01T23:31:11Z" + }, { + "affectedInterfacesCount" : 1, + "endDate" : "2022-03-01T23:31:11Z", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "affectedLocationsCount" : 1, + "endRoundId" : 1646177700, + "affectedTestsCount" : 1, + "type" : "app", + "providerType" : "SAAS", + "duration" : 214, + "startRoundId" : 1646177400, + "name" : "Google", + "id" : "xxxxxxxxxxxxxxxxxx1", + "affectedServersCount" : 2, + "asn" : 19994, + "providerName" : "Google", + "startDate" : "2022-03-01T23:31:11Z" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.internet_insights.models.ApiOutagesResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_app_outage_models_validation(self) -> None: + """Test case for get_app_outage request and response models""" + + response_body_json = """ + { + "affectedDomains" : [ "amazon.com", "amazon.com" ], + "affectedTests" : [ { + "name" : "amazon-test2", + "id" : 5 + }, { + "name" : "amazon-test2", + "id" : 5 + } ], + "endDate" : "2023-01-27T20:53:51.256Z", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "endRoundId" : 1674852600, + "providerType" : "SAAS", + "duration" : 180, + "startRoundId" : 1674852600, + "affectedAgents" : [ { + "name" : "London, England", + "id" : 11 + }, { + "name" : "London, England", + "id" : 11 + } ], + "id" : "0CC4C4209887126DE42E92252FB43962CBB3193147F318EA", + "providerName" : "Amazon Web Services", + "applicationName" : "Amazon Web Services", + "startDate" : "2023-01-27T20:50:51.256Z", + "errors" : [ "HTTP_SERVER_TIMEOUT", "HTTP_SERVER_TIMEOUT" ], + "affectedLocations" : [ { + "location" : "Chicago, Illinois, US", + "affectedServers" : [ { + "prefix" : "123.176.185.0/23", + "domain" : "amazon.com" + }, { + "prefix" : "123.176.185.0/23", + "domain" : "amazon.com" + } ] + }, { + "location" : "Chicago, Illinois, US", + "affectedServers" : [ { + "prefix" : "123.176.185.0/23", + "domain" : "amazon.com" + }, { + "prefix" : "123.176.185.0/23", + "domain" : "amazon.com" + } ] + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.internet_insights.models.ApiApplicationOutageDetails.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_network_outage_models_validation(self) -> None: + """Test case for get_network_outage request and response models""" + + response_body_json = """ + { + "affectedDomains" : [ "periodic-failure.com", "periodic-failure.com" ], + "affectedTests" : [ { + "name" : "amazon-test2", + "id" : 5 + }, { + "name" : "amazon-test2", + "id" : 5 + } ], + "endDate" : "2023-01-27T20:53:51.256Z", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "networkName" : "Rackspace Hosting", + "endRoundId" : 1674852600, + "providerType" : "IAAS", + "duration" : 180, + "startRoundId" : 1674852600, + "affectedAgents" : [ { + "name" : "London, England", + "id" : 11 + }, { + "name" : "London, England", + "id" : 11 + } ], + "id" : "8EF2760862C705783A2F8BCBAAABB44F28DBC670DBA3B610", + "asn" : 19994, + "providerName" : "Rackspace", + "startDate" : "2023-01-27T20:50:51.256Z", + "affectedLocations" : [ { + "affectedInterfaces" : [ "50.51.52.53", "50.51.52.53" ], + "location" : "Chicago, Illinois, US" + }, { + "affectedInterfaces" : [ "50.51.52.53", "50.51.52.53" ], + "location" : "Chicago, Illinois, US" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.internet_insights.models.ApiNetworkOutageDetails.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-snapshots/.openapi-generator/FILES b/thousandeyes-sdk-snapshots/.openapi-generator/FILES index cfe9f55cb..88c13d48d 100644 --- a/thousandeyes-sdk-snapshots/.openapi-generator/FILES +++ b/thousandeyes-sdk-snapshots/.openapi-generator/FILES @@ -2,7 +2,6 @@ MANIFEST.in README.md docs/AppAndSelfLinks.md -docs/CreateTestSnapshotApi.md docs/Error.md docs/Link.md docs/SnapshotLinks.md @@ -12,6 +11,7 @@ docs/SnapshotTest.md docs/TestInterval.md docs/TestLinks.md docs/TestSelfLink.md +docs/TestSnapshotsApi.md docs/TestType.md docs/UnauthorizedError.md docs/UnexpandedInstantTest.md @@ -22,7 +22,7 @@ pyproject.toml setup.cfg src/thousandeyes_sdk/snapshots/__init__.py src/thousandeyes_sdk/snapshots/api/__init__.py -src/thousandeyes_sdk/snapshots/api/create_test_snapshot_api.py +src/thousandeyes_sdk/snapshots/api/test_snapshots_api.py src/thousandeyes_sdk/snapshots/models/__init__.py src/thousandeyes_sdk/snapshots/models/app_and_self_links.py src/thousandeyes_sdk/snapshots/models/error.py @@ -42,5 +42,5 @@ src/thousandeyes_sdk/snapshots/models/validation_error.py src/thousandeyes_sdk/snapshots/models/validation_error_item.py src/thousandeyes_sdk/snapshots/py.typed test/__init__.py -test/test_create_test_snapshot_api.py +test/test_test_snapshots_api.py test/test_utils.py diff --git a/thousandeyes-sdk-snapshots/README.md b/thousandeyes-sdk-snapshots/README.md index 86d46e002..d04c5cc94 100644 --- a/thousandeyes-sdk-snapshots/README.md +++ b/thousandeyes-sdk-snapshots/README.md @@ -3,7 +3,7 @@ Creates a new test snapshot in ThousandEyes. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -75,18 +75,18 @@ configuration = thousandeyes_sdk.core.Configuration( # Enter a context with an instance of the API client with thousandeyes_sdk.core.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.snapshots.CreateTestSnapshotApi(api_client) - test_id = '281474976710706' # str | Test ID. + api_instance = thousandeyes_sdk.snapshots.TestSnapshotsApi(api_client) + test_id = '202701' # str | Test ID snapshot_request = thousandeyes_sdk.snapshots.SnapshotRequest() # SnapshotRequest | aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) try: # Create test snapshot api_response = api_instance.create_test_snapshot(test_id, snapshot_request, aid=aid) - print("The response of CreateTestSnapshotApi->create_test_snapshot:\n") + print("The response of TestSnapshotsApi->create_test_snapshot:\n") pprint(api_response) except ApiException as e: - print("Exception when calling CreateTestSnapshotApi->create_test_snapshot: %s\n" % e) + print("Exception when calling TestSnapshotsApi->create_test_snapshot: %s\n" % e) ``` @@ -96,7 +96,7 @@ All URIs are relative to *https://api.thousandeyes.com/v7* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*CreateTestSnapshotApi* | [**create_test_snapshot**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-snapshots/docs/CreateTestSnapshotApi.md#create_test_snapshot) | **POST** /tests/{testId}/snapshot | Create test snapshot +*TestSnapshotsApi* | [**create_test_snapshot**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-snapshots/docs/TestSnapshotsApi.md#create_test_snapshot) | **POST** /tests/{testId}/snapshot | Create test snapshot ## Documentation For Models diff --git a/thousandeyes-sdk-snapshots/docs/TestSnapshotsApi.md b/thousandeyes-sdk-snapshots/docs/TestSnapshotsApi.md new file mode 100644 index 000000000..baf5bf12c --- /dev/null +++ b/thousandeyes-sdk-snapshots/docs/TestSnapshotsApi.md @@ -0,0 +1,100 @@ +# thousandeyes_sdk.snapshots.TestSnapshotsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_test_snapshot**](TestSnapshotsApi.md#create_test_snapshot) | **POST** /tests/{testId}/snapshot | Create test snapshot + + +# **create_test_snapshot** +> SnapshotResponse create_test_snapshot(test_id, snapshot_request, aid=aid) + +Create test snapshot + +This endpoint creates a test snapshot based on the properties provided in the POST data. * To use this endpoint, you need the `Create snapshot shares` permission. * You can create a maximum of 5 snapshots per organization within a 5-minute interval. * Snapshots generated through this endpoint have a 30-day expiration period. * The time range specified with the `from` and `to` parameters must adhere to one of the following intervals: 1, 2, 4, 6, 12, 24, or 48 hours. * The `endDate` field of the snapshot must be set to the present or a past date. **Note**: This endpoint does not support the creation of Endpoint Agent snapshots. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.snapshots +from thousandeyes_sdk.snapshots.models.snapshot_request import SnapshotRequest +from thousandeyes_sdk.snapshots.models.snapshot_response import SnapshotResponse +from thousandeyes_sdk.snapshots.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.snapshots.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.snapshots.TestSnapshotsApi(api_client) + test_id = '202701' # str | Test ID + snapshot_request = thousandeyes_sdk.snapshots.SnapshotRequest() # SnapshotRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create test snapshot + api_response = api_instance.create_test_snapshot(test_id, snapshot_request, aid=aid) + print("The response of TestSnapshotsApi->create_test_snapshot:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TestSnapshotsApi->create_test_snapshot: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **snapshot_request** | [**SnapshotRequest**](SnapshotRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**SnapshotResponse**](SnapshotResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-snapshots/src/thousandeyes_sdk/snapshots/__init__.py b/thousandeyes-sdk-snapshots/src/thousandeyes_sdk/snapshots/__init__.py index 1f52db4dc..9310ef5e4 100644 --- a/thousandeyes-sdk-snapshots/src/thousandeyes_sdk/snapshots/__init__.py +++ b/thousandeyes-sdk-snapshots/src/thousandeyes_sdk/snapshots/__init__.py @@ -14,7 +14,7 @@ # import apis into sdk package -from thousandeyes_sdk.snapshots.api.create_test_snapshot_api import CreateTestSnapshotApi +from thousandeyes_sdk.snapshots.api.test_snapshots_api import TestSnapshotsApi # import models into sdk package diff --git a/thousandeyes-sdk-snapshots/src/thousandeyes_sdk/snapshots/api/__init__.py b/thousandeyes-sdk-snapshots/src/thousandeyes_sdk/snapshots/api/__init__.py index a37c4762f..625d4869f 100644 --- a/thousandeyes-sdk-snapshots/src/thousandeyes_sdk/snapshots/api/__init__.py +++ b/thousandeyes-sdk-snapshots/src/thousandeyes_sdk/snapshots/api/__init__.py @@ -1,5 +1,5 @@ # flake8: noqa # import apis into api package -from thousandeyes_sdk.snapshots.api.create_test_snapshot_api import CreateTestSnapshotApi +from thousandeyes_sdk.snapshots.api.test_snapshots_api import TestSnapshotsApi diff --git a/thousandeyes-sdk-snapshots/src/thousandeyes_sdk/snapshots/api/test_snapshots_api.py b/thousandeyes-sdk-snapshots/src/thousandeyes_sdk/snapshots/api/test_snapshots_api.py new file mode 100644 index 000000000..f867d9034 --- /dev/null +++ b/thousandeyes-sdk-snapshots/src/thousandeyes_sdk/snapshots/api/test_snapshots_api.py @@ -0,0 +1,371 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.snapshots.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.snapshots.models.snapshot_request import SnapshotRequest +from thousandeyes_sdk.snapshots.models.snapshot_response import SnapshotResponse + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class TestSnapshotsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-snapshots")) + self.api_client = api_client + + + @validate_call + def create_test_snapshot( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + snapshot_request: SnapshotRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SnapshotResponse: + """Create test snapshot + + This endpoint creates a test snapshot based on the properties provided in the POST data. * To use this endpoint, you need the `Create snapshot shares` permission. * You can create a maximum of 5 snapshots per organization within a 5-minute interval. * Snapshots generated through this endpoint have a 30-day expiration period. * The time range specified with the `from` and `to` parameters must adhere to one of the following intervals: 1, 2, 4, 6, 12, 24, or 48 hours. * The `endDate` field of the snapshot must be set to the present or a past date. **Note**: This endpoint does not support the creation of Endpoint Agent snapshots. + + :param test_id: Test ID (required) + :type test_id: str + :param snapshot_request: (required) + :type snapshot_request: SnapshotRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_test_snapshot_serialize( + test_id=test_id, + snapshot_request=snapshot_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SnapshotResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.snapshots.models, + ).data + + + @validate_call + def create_test_snapshot_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + snapshot_request: SnapshotRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SnapshotResponse]: + """Create test snapshot + + This endpoint creates a test snapshot based on the properties provided in the POST data. * To use this endpoint, you need the `Create snapshot shares` permission. * You can create a maximum of 5 snapshots per organization within a 5-minute interval. * Snapshots generated through this endpoint have a 30-day expiration period. * The time range specified with the `from` and `to` parameters must adhere to one of the following intervals: 1, 2, 4, 6, 12, 24, or 48 hours. * The `endDate` field of the snapshot must be set to the present or a past date. **Note**: This endpoint does not support the creation of Endpoint Agent snapshots. + + :param test_id: Test ID (required) + :type test_id: str + :param snapshot_request: (required) + :type snapshot_request: SnapshotRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_test_snapshot_serialize( + test_id=test_id, + snapshot_request=snapshot_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SnapshotResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.snapshots.models, + ) + + + @validate_call + def create_test_snapshot_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + snapshot_request: SnapshotRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create test snapshot + + This endpoint creates a test snapshot based on the properties provided in the POST data. * To use this endpoint, you need the `Create snapshot shares` permission. * You can create a maximum of 5 snapshots per organization within a 5-minute interval. * Snapshots generated through this endpoint have a 30-day expiration period. * The time range specified with the `from` and `to` parameters must adhere to one of the following intervals: 1, 2, 4, 6, 12, 24, or 48 hours. * The `endDate` field of the snapshot must be set to the present or a past date. **Note**: This endpoint does not support the creation of Endpoint Agent snapshots. + + :param test_id: Test ID (required) + :type test_id: str + :param snapshot_request: (required) + :type snapshot_request: SnapshotRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_test_snapshot_serialize( + test_id=test_id, + snapshot_request=snapshot_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SnapshotResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_test_snapshot_serialize( + self, + test_id, + snapshot_request, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if snapshot_request is not None: + _body_params = snapshot_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/{testId}/snapshot', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-snapshots/test/test_test_snapshots_api.py b/thousandeyes-sdk-snapshots/test/test_test_snapshots_api.py new file mode 100644 index 000000000..d24a35cb7 --- /dev/null +++ b/thousandeyes-sdk-snapshots/test/test_test_snapshots_api.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + Test Snapshots API + + Creates a new test snapshot in ThousandEyes. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.snapshots.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.snapshots.api.test_snapshots_api import TestSnapshotsApi + + +class TestTestSnapshotsApi(unittest.TestCase): + """TestSnapshotsApi unit test stubs""" + + def setUp(self) -> None: + self.api = TestSnapshotsApi() + + def tearDown(self) -> None: + pass + + def test_create_test_snapshot_models_validation(self) -> None: + """Test case for create_test_snapshot request and response models""" + request_body_json = """ + { + "endDate" : "2023-06-06T01:00:00Z", + "displayName" : "Snapshot created through API", + "isPublic" : false, + "startDate" : "2023-06-06T00:00:00Z" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.snapshots.models.SnapshotRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "shareDate" : "2023-06-06T00:00:00Z", + "uid" : "281474976810911", + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "startRoundId" : 1538784000, + "displayName" : "Snapshot created through API", + "endRoundId" : 1538787600, + "testId" : "281474976710801", + "extraParams" : "params", + "id" : "wdiac", + "roundId" : 1538784000, + "sourceTestId" : "281474976710706" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.snapshots.models.SnapshotResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-streaming/.openapi-generator/FILES b/thousandeyes-sdk-streaming/.openapi-generator/FILES index 57d5f0136..d2e4ae8f6 100644 --- a/thousandeyes-sdk-streaming/.openapi-generator/FILES +++ b/thousandeyes-sdk-streaming/.openapi-generator/FILES @@ -9,6 +9,8 @@ docs/BadRequestError.md docs/CreateStreamResponse.md docs/DataModelVersion.md docs/EndpointType.md +docs/ExporterConfig.md +docs/ExporterConfigSplunkHec.md docs/GetStreamResponse.md docs/PutStream.md docs/Stream.md @@ -36,6 +38,8 @@ src/thousandeyes_sdk/streaming/models/bad_request_error.py src/thousandeyes_sdk/streaming/models/create_stream_response.py src/thousandeyes_sdk/streaming/models/data_model_version.py src/thousandeyes_sdk/streaming/models/endpoint_type.py +src/thousandeyes_sdk/streaming/models/exporter_config.py +src/thousandeyes_sdk/streaming/models/exporter_config_splunk_hec.py src/thousandeyes_sdk/streaming/models/get_stream_response.py src/thousandeyes_sdk/streaming/models/put_stream.py src/thousandeyes_sdk/streaming/models/stream.py diff --git a/thousandeyes-sdk-streaming/README.md b/thousandeyes-sdk-streaming/README.md index b233aa5dc..84ea65ab1 100644 --- a/thousandeyes-sdk-streaming/README.md +++ b/thousandeyes-sdk-streaming/README.md @@ -15,7 +15,7 @@ For more information about ThousandEyes for OpenTelemetry, see the [documentatio This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -124,6 +124,8 @@ Class | Method | HTTP request | Description - [CreateStreamResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-streaming/docs/CreateStreamResponse.md) - [DataModelVersion](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-streaming/docs/DataModelVersion.md) - [EndpointType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-streaming/docs/EndpointType.md) + - [ExporterConfig](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-streaming/docs/ExporterConfig.md) + - [ExporterConfigSplunkHec](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-streaming/docs/ExporterConfigSplunkHec.md) - [GetStreamResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-streaming/docs/GetStreamResponse.md) - [PutStream](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-streaming/docs/PutStream.md) - [Stream](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-streaming/docs/Stream.md) diff --git a/thousandeyes-sdk-streaming/docs/CreateStreamResponse.md b/thousandeyes-sdk-streaming/docs/CreateStreamResponse.md index 0ca9e5456..e8bf3232a 100644 --- a/thousandeyes-sdk-streaming/docs/CreateStreamResponse.md +++ b/thousandeyes-sdk-streaming/docs/CreateStreamResponse.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **custom_headers** | **Dict[str, str]** | Custom headers. **Note**: When using the `splunk-hec` `type`, the `customHeaders` must contain just one element with the key `token` and the value of the *Splunk HEC Token*. | [optional] **tag_match** | [**List[TagMatch]**](TagMatch.md) | A collection of tags that determine what tests are included in the data stream. These tag values are also included as attributes in the data stream metrics. | [optional] **test_match** | [**List[TestMatch]**](TestMatch.md) | A collection of tests to be included in the data stream. | [optional] +**exporter_config** | [**ExporterConfig**](ExporterConfig.md) | | [optional] **audit_operation** | [**AuditOperation**](AuditOperation.md) | | [optional] ## Example diff --git a/thousandeyes-sdk-streaming/docs/DataModelVersion.md b/thousandeyes-sdk-streaming/docs/DataModelVersion.md index 990977c2a..34b29b057 100644 --- a/thousandeyes-sdk-streaming/docs/DataModelVersion.md +++ b/thousandeyes-sdk-streaming/docs/DataModelVersion.md @@ -1,6 +1,6 @@ # DataModelVersion -The version of the data model used in the data stream. **Note**: The data model version is currently fixed at `v1`. +The version of the data model used in the data stream. Default: `v2` ## Properties diff --git a/thousandeyes-sdk-streaming/docs/EndpointType.md b/thousandeyes-sdk-streaming/docs/EndpointType.md index 63f3400a3..60337e354 100644 --- a/thousandeyes-sdk-streaming/docs/EndpointType.md +++ b/thousandeyes-sdk-streaming/docs/EndpointType.md @@ -1,6 +1,6 @@ # EndpointType -The type of connection used to send data to the endpoint. **Note**: When using the `splunk-hec` 'type', the `EndpointType` must be `http`. +The type of connection used to send data to the endpoint. Default: `grpc` **Note**: When using the `splunk-hec` 'type', the `EndpointType` must be `http`. ## Properties diff --git a/thousandeyes-sdk-streaming/docs/ExporterConfig.md b/thousandeyes-sdk-streaming/docs/ExporterConfig.md new file mode 100644 index 000000000..d49c4274a --- /dev/null +++ b/thousandeyes-sdk-streaming/docs/ExporterConfig.md @@ -0,0 +1,30 @@ +# ExporterConfig + +Capability to set exporter configuration. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**splunk_hec** | [**ExporterConfigSplunkHec**](ExporterConfigSplunkHec.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.streaming.models.exporter_config import ExporterConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of ExporterConfig from a JSON string +exporter_config_instance = ExporterConfig.from_json(json) +# print the JSON string representation of the object +print(ExporterConfig.to_json()) + +# convert the object into a dict +exporter_config_dict = exporter_config_instance.to_dict() +# create an instance of ExporterConfig from a dict +exporter_config_from_dict = ExporterConfig.from_dict(exporter_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-streaming/docs/ExporterConfigSplunkHec.md b/thousandeyes-sdk-streaming/docs/ExporterConfigSplunkHec.md new file mode 100644 index 000000000..90394d33d --- /dev/null +++ b/thousandeyes-sdk-streaming/docs/ExporterConfigSplunkHec.md @@ -0,0 +1,33 @@ +# ExporterConfigSplunkHec + +Splunk HEC configuration. This can only be configured when the `type` is `splunk-hec`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token** | **str** | The Splunk HEC `token`. This is a required field. | [optional] +**source** | **str** | The Splunk HEC `source`. This field is optional. Default: `ThousandEyesOTel` | [optional] [default to 'ThousandEyesOTel'] +**source_type** | **str** | The Splunk HEC `sourceType`. This field is optional. Default: `ThousandEyesOTel` | [optional] [default to 'ThousandEyesOTel'] +**index** | **str** | The name of the Splunk HEC index where the event data will be stored. This field is optional. | [optional] + +## Example + +```python +from thousandeyes_sdk.streaming.models.exporter_config_splunk_hec import ExporterConfigSplunkHec + +# TODO update the JSON string below +json = "{}" +# create an instance of ExporterConfigSplunkHec from a JSON string +exporter_config_splunk_hec_instance = ExporterConfigSplunkHec.from_json(json) +# print the JSON string representation of the object +print(ExporterConfigSplunkHec.to_json()) + +# convert the object into a dict +exporter_config_splunk_hec_dict = exporter_config_splunk_hec_instance.to_dict() +# create an instance of ExporterConfigSplunkHec from a dict +exporter_config_splunk_hec_from_dict = ExporterConfigSplunkHec.from_dict(exporter_config_splunk_hec_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-streaming/docs/GetStreamResponse.md b/thousandeyes-sdk-streaming/docs/GetStreamResponse.md index 3efb76f01..ac5787950 100644 --- a/thousandeyes-sdk-streaming/docs/GetStreamResponse.md +++ b/thousandeyes-sdk-streaming/docs/GetStreamResponse.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **custom_headers** | **Dict[str, str]** | Custom headers. **Note**: When using the `splunk-hec` `type`, the `customHeaders` must contain just one element with the key `token` and the value of the *Splunk HEC Token*. | [optional] **tag_match** | [**List[TagMatch]**](TagMatch.md) | A collection of tags that determine what tests are included in the data stream. These tag values are also included as attributes in the data stream metrics. | [optional] **test_match** | [**List[TestMatch]**](TestMatch.md) | A collection of tests to be included in the data stream. | [optional] +**exporter_config** | [**ExporterConfig**](ExporterConfig.md) | | [optional] **audit_operation** | [**AuditOperationWithUpdate**](AuditOperationWithUpdate.md) | | [optional] ## Example diff --git a/thousandeyes-sdk-streaming/docs/PutStream.md b/thousandeyes-sdk-streaming/docs/PutStream.md index be862955c..ef8923123 100644 --- a/thousandeyes-sdk-streaming/docs/PutStream.md +++ b/thousandeyes-sdk-streaming/docs/PutStream.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **tag_match** | [**List[TagMatch]**](TagMatch.md) | A collection of tags that determine what tests are included in the data stream. These tag values are also included as attributes in the data stream metrics. | [optional] **test_match** | [**List[TestMatch]**](TestMatch.md) | A collection of tests to be included in the data stream. | [optional] **enabled** | **bool** | Flag to enable or disable the stream integration. | [optional] +**exporter_config** | [**ExporterConfig**](ExporterConfig.md) | | [optional] ## Example diff --git a/thousandeyes-sdk-streaming/docs/Stream.md b/thousandeyes-sdk-streaming/docs/Stream.md index b807e6f0e..cfea203b4 100644 --- a/thousandeyes-sdk-streaming/docs/Stream.md +++ b/thousandeyes-sdk-streaming/docs/Stream.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **tag_match** | [**List[TagMatch]**](TagMatch.md) | A collection of tags that determine what tests are included in the data stream. These tag values are also included as attributes in the data stream metrics. | [optional] **test_match** | [**List[TestMatch]**](TestMatch.md) | A collection of tests to be included in the data stream. | [optional] **enabled** | **bool** | Flag to enable or disable the stream integration. | [optional] +**exporter_config** | [**ExporterConfig**](ExporterConfig.md) | | [optional] **type** | [**StreamType**](StreamType.md) | | [optional] **endpoint_type** | [**EndpointType**](EndpointType.md) | | [optional] **stream_endpoint_url** | **str** | The URL ThousandEyes sends data stream to. For a URL to be valid, it needs to: - Be syntactically correct. - Be reachable. - Use the HTTPS protocol. - When using the `grpc` endpointType, streamEndpointUrl cannot contain paths: - Valid . `grpc` - `https://example.com` - Invalid . `grpc` - `https://example.com/collector`. - Valid . `http` - `https://example.com/collector`. - When using the `http` endpointType, the endpoint must match the exact final full URL (including the path if there is one) to which the metrics will be sent. Examples below: - `https://api.honeycomb.io:443/v1/metrics` - `https://ingest.eu0.signalfx.com/v2/datapoint/otlp` | [optional] diff --git a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/__init__.py b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/__init__.py index ab0717e7e..b54dc1b76 100644 --- a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/__init__.py +++ b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/__init__.py @@ -26,6 +26,8 @@ from thousandeyes_sdk.streaming.models.create_stream_response import CreateStreamResponse from thousandeyes_sdk.streaming.models.data_model_version import DataModelVersion from thousandeyes_sdk.streaming.models.endpoint_type import EndpointType +from thousandeyes_sdk.streaming.models.exporter_config import ExporterConfig +from thousandeyes_sdk.streaming.models.exporter_config_splunk_hec import ExporterConfigSplunkHec from thousandeyes_sdk.streaming.models.get_stream_response import GetStreamResponse from thousandeyes_sdk.streaming.models.put_stream import PutStream from thousandeyes_sdk.streaming.models.stream import Stream diff --git a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/__init__.py b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/__init__.py index 5dcf18ee8..888a5f235 100644 --- a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/__init__.py +++ b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/__init__.py @@ -21,6 +21,8 @@ from thousandeyes_sdk.streaming.models.create_stream_response import CreateStreamResponse from thousandeyes_sdk.streaming.models.data_model_version import DataModelVersion from thousandeyes_sdk.streaming.models.endpoint_type import EndpointType +from thousandeyes_sdk.streaming.models.exporter_config import ExporterConfig +from thousandeyes_sdk.streaming.models.exporter_config_splunk_hec import ExporterConfigSplunkHec from thousandeyes_sdk.streaming.models.get_stream_response import GetStreamResponse from thousandeyes_sdk.streaming.models.put_stream import PutStream from thousandeyes_sdk.streaming.models.stream import Stream diff --git a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/create_stream_response.py b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/create_stream_response.py index 5fcf7e111..ef48bf404 100644 --- a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/create_stream_response.py +++ b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/create_stream_response.py @@ -21,6 +21,7 @@ from thousandeyes_sdk.streaming.models.audit_operation import AuditOperation from thousandeyes_sdk.streaming.models.data_model_version import DataModelVersion from thousandeyes_sdk.streaming.models.endpoint_type import EndpointType +from thousandeyes_sdk.streaming.models.exporter_config import ExporterConfig from thousandeyes_sdk.streaming.models.stream_links import StreamLinks from thousandeyes_sdk.streaming.models.stream_type import StreamType from thousandeyes_sdk.streaming.models.tag_match import TagMatch @@ -42,8 +43,9 @@ class CreateStreamResponse(BaseModel): custom_headers: Optional[Dict[str, StrictStr]] = Field(default=None, description="Custom headers. **Note**: When using the `splunk-hec` `type`, the `customHeaders` must contain just one element with the key `token` and the value of the *Splunk HEC Token*.", alias="customHeaders") tag_match: Optional[List[TagMatch]] = Field(default=None, description="A collection of tags that determine what tests are included in the data stream. These tag values are also included as attributes in the data stream metrics.", alias="tagMatch") test_match: Optional[List[TestMatch]] = Field(default=None, description="A collection of tests to be included in the data stream.", alias="testMatch") + exporter_config: Optional[ExporterConfig] = Field(default=None, alias="exporterConfig") audit_operation: Optional[AuditOperation] = Field(default=None, alias="auditOperation") - __properties: ClassVar[List[str]] = ["id", "enabled", "_links", "type", "endpointType", "streamEndpointUrl", "dataModelVersion", "customHeaders", "tagMatch", "testMatch", "auditOperation"] + __properties: ClassVar[List[str]] = ["id", "enabled", "_links", "type", "endpointType", "streamEndpointUrl", "dataModelVersion", "customHeaders", "tagMatch", "testMatch", "exporterConfig", "auditOperation"] model_config = ConfigDict( populate_by_name=True, @@ -104,6 +106,9 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['testMatch'] = _items + # override the default output from pydantic by calling `to_dict()` of exporter_config + if self.exporter_config: + _dict['exporterConfig'] = self.exporter_config.to_dict() # override the default output from pydantic by calling `to_dict()` of audit_operation if self.audit_operation: _dict['auditOperation'] = self.audit_operation.to_dict() @@ -129,6 +134,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "customHeaders": obj.get("customHeaders"), "tagMatch": [TagMatch.from_dict(_item) for _item in obj["tagMatch"]] if obj.get("tagMatch") is not None else None, "testMatch": [TestMatch.from_dict(_item) for _item in obj["testMatch"]] if obj.get("testMatch") is not None else None, + "exporterConfig": ExporterConfig.from_dict(obj["exporterConfig"]) if obj.get("exporterConfig") is not None else None, "auditOperation": AuditOperation.from_dict(obj["auditOperation"]) if obj.get("auditOperation") is not None else None }) return _obj diff --git a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/data_model_version.py b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/data_model_version.py index 6202b7c11..f9119561c 100644 --- a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/data_model_version.py +++ b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/data_model_version.py @@ -19,13 +19,14 @@ class DataModelVersion(str, Enum): """ - The version of the data model used in the data stream. **Note**: The data model version is currently fixed at `v1`. + The version of the data model used in the data stream. Default: `v2` """ """ allowed enum values """ V1 = 'v1' + V2 = 'v2' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/endpoint_type.py b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/endpoint_type.py index 19a6d0620..7c3aa2f96 100644 --- a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/endpoint_type.py +++ b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/endpoint_type.py @@ -19,7 +19,7 @@ class EndpointType(str, Enum): """ - The type of connection used to send data to the endpoint. **Note**: When using the `splunk-hec` 'type', the `EndpointType` must be `http`. + The type of connection used to send data to the endpoint. Default: `grpc` **Note**: When using the `splunk-hec` 'type', the `EndpointType` must be `http`. """ """ diff --git a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/exporter_config.py b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/exporter_config.py new file mode 100644 index 000000000..6c97863f1 --- /dev/null +++ b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/exporter_config.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry API + + ThousandEyes for OpenTelemetry provides machine-to-machine integration between ThousandEyes and its customers. It allows you to export ThousandEyes telemetry data in OTel format, which is widely used in the industry. With ThousandEyes for OTel, you can leverage frameworks widely used in the observability domain - such as Splunk, Grafana, and Honeycomb - to capture and analyze ThousandEyes data. Any client that supports OTel can use ThousandEyes for OpenTelemetry. ThousandEyes for OTel is made up of the following components: * Data streaming APIs that you can use to configure and enable your ThousandEyes tests with OTel-compatible streams, in particular to configure how ThousandEyes telemetry data is exported to client integrations. * A set of streaming pipelines called _collectors_ that actively fetch ThousandEyes network test data, enrich the data with some additional detail, filter, and push the data to the customer-configured endpoints, depending on what you configure via the public APIs. * Third-party OTel collectors that receive, transform, filter, and export different metrics to client applications such as AppD, or any other OTel-capable client configuration. For more information about ThousandEyes for OpenTelemetry, see the [documentation](https://docs.thousandeyes.com/product-documentation/api/opentelemetry). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.streaming.models.exporter_config_splunk_hec import ExporterConfigSplunkHec +from typing import Optional, Set +from typing_extensions import Self + +class ExporterConfig(BaseModel): + """ + Capability to set exporter configuration. + """ # noqa: E501 + splunk_hec: Optional[ExporterConfigSplunkHec] = Field(default=None, alias="splunkHec") + __properties: ClassVar[List[str]] = ["splunkHec"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExporterConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of splunk_hec + if self.splunk_hec: + _dict['splunkHec'] = self.splunk_hec.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExporterConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "splunkHec": ExporterConfigSplunkHec.from_dict(obj["splunkHec"]) if obj.get("splunkHec") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/exporter_config_splunk_hec.py b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/exporter_config_splunk_hec.py new file mode 100644 index 000000000..a7573200a --- /dev/null +++ b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/exporter_config_splunk_hec.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry API + + ThousandEyes for OpenTelemetry provides machine-to-machine integration between ThousandEyes and its customers. It allows you to export ThousandEyes telemetry data in OTel format, which is widely used in the industry. With ThousandEyes for OTel, you can leverage frameworks widely used in the observability domain - such as Splunk, Grafana, and Honeycomb - to capture and analyze ThousandEyes data. Any client that supports OTel can use ThousandEyes for OpenTelemetry. ThousandEyes for OTel is made up of the following components: * Data streaming APIs that you can use to configure and enable your ThousandEyes tests with OTel-compatible streams, in particular to configure how ThousandEyes telemetry data is exported to client integrations. * A set of streaming pipelines called _collectors_ that actively fetch ThousandEyes network test data, enrich the data with some additional detail, filter, and push the data to the customer-configured endpoints, depending on what you configure via the public APIs. * Third-party OTel collectors that receive, transform, filter, and export different metrics to client applications such as AppD, or any other OTel-capable client configuration. For more information about ThousandEyes for OpenTelemetry, see the [documentation](https://docs.thousandeyes.com/product-documentation/api/opentelemetry). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ExporterConfigSplunkHec(BaseModel): + """ + Splunk HEC configuration. This can only be configured when the `type` is `splunk-hec`. + """ # noqa: E501 + token: Optional[StrictStr] = Field(default=None, description="The Splunk HEC `token`. This is a required field.") + source: Optional[StrictStr] = Field(default='ThousandEyesOTel', description="The Splunk HEC `source`. This field is optional. Default: `ThousandEyesOTel`") + source_type: Optional[StrictStr] = Field(default='ThousandEyesOTel', description="The Splunk HEC `sourceType`. This field is optional. Default: `ThousandEyesOTel`", alias="sourceType") + index: Optional[StrictStr] = Field(default=None, description="The name of the Splunk HEC index where the event data will be stored. This field is optional.") + __properties: ClassVar[List[str]] = ["token", "source", "sourceType", "index"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExporterConfigSplunkHec from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExporterConfigSplunkHec from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "token": obj.get("token"), + "source": obj.get("source") if obj.get("source") is not None else 'ThousandEyesOTel', + "sourceType": obj.get("sourceType") if obj.get("sourceType") is not None else 'ThousandEyesOTel', + "index": obj.get("index") + }) + return _obj + + diff --git a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/get_stream_response.py b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/get_stream_response.py index 075b15c50..359073345 100644 --- a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/get_stream_response.py +++ b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/get_stream_response.py @@ -21,6 +21,7 @@ from thousandeyes_sdk.streaming.models.audit_operation_with_update import AuditOperationWithUpdate from thousandeyes_sdk.streaming.models.data_model_version import DataModelVersion from thousandeyes_sdk.streaming.models.endpoint_type import EndpointType +from thousandeyes_sdk.streaming.models.exporter_config import ExporterConfig from thousandeyes_sdk.streaming.models.stream_links import StreamLinks from thousandeyes_sdk.streaming.models.stream_type import StreamType from thousandeyes_sdk.streaming.models.tag_match import TagMatch @@ -42,8 +43,9 @@ class GetStreamResponse(BaseModel): custom_headers: Optional[Dict[str, StrictStr]] = Field(default=None, description="Custom headers. **Note**: When using the `splunk-hec` `type`, the `customHeaders` must contain just one element with the key `token` and the value of the *Splunk HEC Token*.", alias="customHeaders") tag_match: Optional[List[TagMatch]] = Field(default=None, description="A collection of tags that determine what tests are included in the data stream. These tag values are also included as attributes in the data stream metrics.", alias="tagMatch") test_match: Optional[List[TestMatch]] = Field(default=None, description="A collection of tests to be included in the data stream.", alias="testMatch") + exporter_config: Optional[ExporterConfig] = Field(default=None, alias="exporterConfig") audit_operation: Optional[AuditOperationWithUpdate] = Field(default=None, alias="auditOperation") - __properties: ClassVar[List[str]] = ["id", "enabled", "_links", "type", "endpointType", "streamEndpointUrl", "dataModelVersion", "customHeaders", "tagMatch", "testMatch", "auditOperation"] + __properties: ClassVar[List[str]] = ["id", "enabled", "_links", "type", "endpointType", "streamEndpointUrl", "dataModelVersion", "customHeaders", "tagMatch", "testMatch", "exporterConfig", "auditOperation"] model_config = ConfigDict( populate_by_name=True, @@ -104,6 +106,9 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['testMatch'] = _items + # override the default output from pydantic by calling `to_dict()` of exporter_config + if self.exporter_config: + _dict['exporterConfig'] = self.exporter_config.to_dict() # override the default output from pydantic by calling `to_dict()` of audit_operation if self.audit_operation: _dict['auditOperation'] = self.audit_operation.to_dict() @@ -129,6 +134,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "customHeaders": obj.get("customHeaders"), "tagMatch": [TagMatch.from_dict(_item) for _item in obj["tagMatch"]] if obj.get("tagMatch") is not None else None, "testMatch": [TestMatch.from_dict(_item) for _item in obj["testMatch"]] if obj.get("testMatch") is not None else None, + "exporterConfig": ExporterConfig.from_dict(obj["exporterConfig"]) if obj.get("exporterConfig") is not None else None, "auditOperation": AuditOperationWithUpdate.from_dict(obj["auditOperation"]) if obj.get("auditOperation") is not None else None }) return _obj diff --git a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/put_stream.py b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/put_stream.py index 057d38355..57c236480 100644 --- a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/put_stream.py +++ b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/put_stream.py @@ -18,6 +18,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.streaming.models.exporter_config import ExporterConfig from thousandeyes_sdk.streaming.models.tag_match import TagMatch from thousandeyes_sdk.streaming.models.test_match import TestMatch from typing import Optional, Set @@ -31,7 +32,8 @@ class PutStream(BaseModel): tag_match: Optional[List[TagMatch]] = Field(default=None, description="A collection of tags that determine what tests are included in the data stream. These tag values are also included as attributes in the data stream metrics.", alias="tagMatch") test_match: Optional[List[TestMatch]] = Field(default=None, description="A collection of tests to be included in the data stream.", alias="testMatch") enabled: Optional[StrictBool] = Field(default=None, description="Flag to enable or disable the stream integration.") - __properties: ClassVar[List[str]] = ["customHeaders", "tagMatch", "testMatch", "enabled"] + exporter_config: Optional[ExporterConfig] = Field(default=None, alias="exporterConfig") + __properties: ClassVar[List[str]] = ["customHeaders", "tagMatch", "testMatch", "enabled", "exporterConfig"] model_config = ConfigDict( populate_by_name=True, @@ -87,6 +89,9 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['testMatch'] = _items + # override the default output from pydantic by calling `to_dict()` of exporter_config + if self.exporter_config: + _dict['exporterConfig'] = self.exporter_config.to_dict() return _dict @classmethod @@ -102,7 +107,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "customHeaders": obj.get("customHeaders"), "tagMatch": [TagMatch.from_dict(_item) for _item in obj["tagMatch"]] if obj.get("tagMatch") is not None else None, "testMatch": [TestMatch.from_dict(_item) for _item in obj["testMatch"]] if obj.get("testMatch") is not None else None, - "enabled": obj.get("enabled") + "enabled": obj.get("enabled"), + "exporterConfig": ExporterConfig.from_dict(obj["exporterConfig"]) if obj.get("exporterConfig") is not None else None }) return _obj diff --git a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/stream.py b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/stream.py index bd9efc2c0..90828fae4 100644 --- a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/stream.py +++ b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/stream.py @@ -20,6 +20,7 @@ from typing import Any, ClassVar, Dict, List, Optional from thousandeyes_sdk.streaming.models.data_model_version import DataModelVersion from thousandeyes_sdk.streaming.models.endpoint_type import EndpointType +from thousandeyes_sdk.streaming.models.exporter_config import ExporterConfig from thousandeyes_sdk.streaming.models.stream_type import StreamType from thousandeyes_sdk.streaming.models.tag_match import TagMatch from thousandeyes_sdk.streaming.models.test_match import TestMatch @@ -34,11 +35,12 @@ class Stream(BaseModel): tag_match: Optional[List[TagMatch]] = Field(default=None, description="A collection of tags that determine what tests are included in the data stream. These tag values are also included as attributes in the data stream metrics.", alias="tagMatch") test_match: Optional[List[TestMatch]] = Field(default=None, description="A collection of tests to be included in the data stream.", alias="testMatch") enabled: Optional[StrictBool] = Field(default=None, description="Flag to enable or disable the stream integration.") + exporter_config: Optional[ExporterConfig] = Field(default=None, alias="exporterConfig") type: Optional[StreamType] = None endpoint_type: Optional[EndpointType] = Field(default=None, alias="endpointType") stream_endpoint_url: Optional[StrictStr] = Field(default=None, description="The URL ThousandEyes sends data stream to. For a URL to be valid, it needs to: - Be syntactically correct. - Be reachable. - Use the HTTPS protocol. - When using the `grpc` endpointType, streamEndpointUrl cannot contain paths: - Valid . `grpc` - `https://example.com` - Invalid . `grpc` - `https://example.com/collector`. - Valid . `http` - `https://example.com/collector`. - When using the `http` endpointType, the endpoint must match the exact final full URL (including the path if there is one) to which the metrics will be sent. Examples below: - `https://api.honeycomb.io:443/v1/metrics` - `https://ingest.eu0.signalfx.com/v2/datapoint/otlp`", alias="streamEndpointUrl") data_model_version: Optional[DataModelVersion] = Field(default=None, alias="dataModelVersion") - __properties: ClassVar[List[str]] = ["customHeaders", "tagMatch", "testMatch", "enabled", "type", "endpointType", "streamEndpointUrl", "dataModelVersion"] + __properties: ClassVar[List[str]] = ["customHeaders", "tagMatch", "testMatch", "enabled", "exporterConfig", "type", "endpointType", "streamEndpointUrl", "dataModelVersion"] model_config = ConfigDict( populate_by_name=True, @@ -94,6 +96,9 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['testMatch'] = _items + # override the default output from pydantic by calling `to_dict()` of exporter_config + if self.exporter_config: + _dict['exporterConfig'] = self.exporter_config.to_dict() return _dict @classmethod @@ -110,6 +115,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "tagMatch": [TagMatch.from_dict(_item) for _item in obj["tagMatch"]] if obj.get("tagMatch") is not None else None, "testMatch": [TestMatch.from_dict(_item) for _item in obj["testMatch"]] if obj.get("testMatch") is not None else None, "enabled": obj.get("enabled"), + "exporterConfig": ExporterConfig.from_dict(obj["exporterConfig"]) if obj.get("exporterConfig") is not None else None, "type": obj.get("type"), "endpointType": obj.get("endpointType"), "streamEndpointUrl": obj.get("streamEndpointUrl"), diff --git a/thousandeyes-sdk-streaming/test/test_streaming_api.py b/thousandeyes-sdk-streaming/test/test_streaming_api.py index 6d82c31d2..51adcd480 100644 --- a/thousandeyes-sdk-streaming/test/test_streaming_api.py +++ b/thousandeyes-sdk-streaming/test/test_streaming_api.py @@ -41,6 +41,14 @@ def test_create_stream_models_validation(self) -> None: } ], "endpointType" : "grpc", "streamEndpointUrl" : "https://api.thousandeyes.otel-collector", + "exporterConfig" : { + "splunkHec" : { + "sourceType" : "ThousandEyesOTel", + "index" : "thousandeyes_otel_events_index", + "source" : "ThousandEyesOTel", + "token" : "d0a91307-be2f-4218-a9f8-71c02d98846b" + } + }, "tagMatch" : [ { "key" : "keyA", "value" : "valueA" @@ -49,7 +57,7 @@ def test_create_stream_models_validation(self) -> None: "value" : "valueB" } ], "type" : "opentelemetry", - "dataModelVersion" : "v1", + "dataModelVersion" : "v2", "customHeaders" : { "Authorization" : "*****", "Content-Type" : "*****" @@ -77,6 +85,14 @@ def test_create_stream_models_validation(self) -> None: } }, "streamEndpointUrl" : "https://api.thousandeyes.otel-collector", + "exporterConfig" : { + "splunkHec" : { + "sourceType" : "ThousandEyesOTel", + "index" : "thousandeyes_otel_events_index", + "source" : "ThousandEyesOTel", + "token" : "d0a91307-be2f-4218-a9f8-71c02d98846b" + } + }, "tagMatch" : [ { "key" : "keyA", "value" : "valueA" @@ -91,7 +107,7 @@ def test_create_stream_models_validation(self) -> None: "createdBy" : 3962 }, "enabled" : true, - "dataModelVersion" : "v1", + "dataModelVersion" : "v2", "customHeaders" : { "Authorization" : "*****", "Content-Type" : "*****" @@ -125,6 +141,14 @@ def test_get_stream_models_validation(self) -> None: } }, "streamEndpointUrl" : "https://api.thousandeyes.otel-collector", + "exporterConfig" : { + "splunkHec" : { + "sourceType" : "ThousandEyesOTel", + "index" : "thousandeyes_otel_events_index", + "source" : "ThousandEyesOTel", + "token" : "d0a91307-be2f-4218-a9f8-71c02d98846b" + } + }, "tagMatch" : [ { "key" : "keyA", "value" : "valueA" @@ -141,7 +165,7 @@ def test_get_stream_models_validation(self) -> None: "updatedDate" : 1679677853573 }, "enabled" : true, - "dataModelVersion" : "v1", + "dataModelVersion" : "v2", "customHeaders" : { "Authorization" : "*****", "Content-Type" : "*****" @@ -171,6 +195,14 @@ def test_get_streams_models_validation(self) -> None: } }, "streamEndpointUrl" : "https://api.thousandeyes.otel-collector", + "exporterConfig" : { + "splunkHec" : { + "sourceType" : "ThousandEyesOTel", + "index" : "thousandeyes_otel_events_index", + "source" : "ThousandEyesOTel", + "token" : "d0a91307-be2f-4218-a9f8-71c02d98846b" + } + }, "tagMatch" : [ { "key" : "keyA", "value" : "valueA" @@ -187,7 +219,7 @@ def test_get_streams_models_validation(self) -> None: "updatedDate" : 1679677853573 }, "enabled" : true, - "dataModelVersion" : "v1", + "dataModelVersion" : "v2", "customHeaders" : { "Authorization" : "*****", "Content-Type" : "*****" @@ -207,6 +239,14 @@ def test_get_streams_models_validation(self) -> None: } }, "streamEndpointUrl" : "https://api.thousandeyes.otel-collector", + "exporterConfig" : { + "splunkHec" : { + "sourceType" : "ThousandEyesOTel", + "index" : "thousandeyes_otel_events_index", + "source" : "ThousandEyesOTel", + "token" : "d0a91307-be2f-4218-a9f8-71c02d98846b" + } + }, "tagMatch" : [ { "key" : "keyA", "value" : "valueA" @@ -223,7 +263,7 @@ def test_get_streams_models_validation(self) -> None: "updatedDate" : 1679677853573 }, "enabled" : true, - "dataModelVersion" : "v1", + "dataModelVersion" : "v2", "customHeaders" : { "Authorization" : "*****", "Content-Type" : "*****" @@ -248,6 +288,14 @@ def test_update_stream_models_validation(self) -> None: "id" : "5678", "domain" : "endpoint" } ], + "exporterConfig" : { + "splunkHec" : { + "sourceType" : "ThousandEyesOTel", + "index" : "thousandeyes_otel_events_index", + "source" : "ThousandEyesOTel", + "token" : "d0a91307-be2f-4218-a9f8-71c02d98846b" + } + }, "tagMatch" : [ { "key" : "keyA", "value" : "valueA" @@ -282,6 +330,14 @@ def test_update_stream_models_validation(self) -> None: } }, "streamEndpointUrl" : "https://api.thousandeyes.otel-collector", + "exporterConfig" : { + "splunkHec" : { + "sourceType" : "ThousandEyesOTel", + "index" : "thousandeyes_otel_events_index", + "source" : "ThousandEyesOTel", + "token" : "d0a91307-be2f-4218-a9f8-71c02d98846b" + } + }, "tagMatch" : [ { "key" : "keyA", "value" : "valueA" @@ -298,7 +354,7 @@ def test_update_stream_models_validation(self) -> None: "updatedDate" : 1679677853573 }, "enabled" : true, - "dataModelVersion" : "v1", + "dataModelVersion" : "v2", "customHeaders" : { "Authorization" : "*****", "Content-Type" : "*****" diff --git a/thousandeyes-sdk-tags/.openapi-generator/FILES b/thousandeyes-sdk-tags/.openapi-generator/FILES index 6740a142a..c23e3c668 100644 --- a/thousandeyes-sdk-tags/.openapi-generator/FILES +++ b/thousandeyes-sdk-tags/.openapi-generator/FILES @@ -9,7 +9,7 @@ docs/BulkTagAssignment.md docs/BulkTagAssignments.md docs/BulkTagResponse.md docs/Error.md -docs/Expand.md +docs/ExpandTagsOptions.md docs/Link.md docs/ObjectType.md docs/SelfLinks.md @@ -38,7 +38,7 @@ src/thousandeyes_sdk/tags/models/bulk_tag_assignment.py src/thousandeyes_sdk/tags/models/bulk_tag_assignments.py src/thousandeyes_sdk/tags/models/bulk_tag_response.py src/thousandeyes_sdk/tags/models/error.py -src/thousandeyes_sdk/tags/models/expand.py +src/thousandeyes_sdk/tags/models/expand_tags_options.py src/thousandeyes_sdk/tags/models/link.py src/thousandeyes_sdk/tags/models/object_type.py src/thousandeyes_sdk/tags/models/self_links.py diff --git a/thousandeyes-sdk-tags/README.md b/thousandeyes-sdk-tags/README.md index 6ac939304..98ef33977 100644 --- a/thousandeyes-sdk-tags/README.md +++ b/thousandeyes-sdk-tags/README.md @@ -16,7 +16,7 @@ Things to note with the ThousandEyes Tags API: This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -89,7 +89,7 @@ configuration = thousandeyes_sdk.core.Configuration( with thousandeyes_sdk.core.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = thousandeyes_sdk.tags.TagAssignmentApi(api_client) - id = 'c6b78e57-81a2-4c5f-a11a-d96c3c664d55' # str | ID of the tag to associate + id = 'c6b78e57-81a2-4c5f-a11a-d96c3c664d55' # str | Tag ID tag_assignment = thousandeyes_sdk.tags.TagAssignment() # TagAssignment | aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) @@ -129,7 +129,7 @@ Class | Method | HTTP request | Description - [BulkTagAssignments](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tags/docs/BulkTagAssignments.md) - [BulkTagResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tags/docs/BulkTagResponse.md) - [Error](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tags/docs/Error.md) - - [Expand](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tags/docs/Expand.md) + - [ExpandTagsOptions](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tags/docs/ExpandTagsOptions.md) - [Link](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tags/docs/Link.md) - [ObjectType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tags/docs/ObjectType.md) - [SelfLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tags/docs/SelfLinks.md) diff --git a/thousandeyes-sdk-tags/docs/ExpandTagsOptions.md b/thousandeyes-sdk-tags/docs/ExpandTagsOptions.md new file mode 100644 index 000000000..dd29f5888 --- /dev/null +++ b/thousandeyes-sdk-tags/docs/ExpandTagsOptions.md @@ -0,0 +1,11 @@ +# ExpandTagsOptions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tags/docs/TagAssignmentApi.md b/thousandeyes-sdk-tags/docs/TagAssignmentApi.md index b2dda00f1..c7be657bf 100644 --- a/thousandeyes-sdk-tags/docs/TagAssignmentApi.md +++ b/thousandeyes-sdk-tags/docs/TagAssignmentApi.md @@ -47,7 +47,7 @@ configuration = thousandeyes_sdk.core.Configuration( with thousandeyes_sdk.tags.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = thousandeyes_sdk.tags.TagAssignmentApi(api_client) - id = 'c6b78e57-81a2-4c5f-a11a-d96c3c664d55' # str | ID of the tag to associate + id = 'c6b78e57-81a2-4c5f-a11a-d96c3c664d55' # str | Tag ID tag_assignment = thousandeyes_sdk.tags.TagAssignment() # TagAssignment | aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) @@ -65,7 +65,7 @@ with thousandeyes_sdk.tags.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of the tag to associate | + **id** | **str**| Tag ID | **tag_assignment** | [**TagAssignment**](TagAssignment.md)| | **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] @@ -215,7 +215,7 @@ configuration = thousandeyes_sdk.core.Configuration( with thousandeyes_sdk.tags.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = thousandeyes_sdk.tags.TagAssignmentApi(api_client) - id = '2983u1' # str | ID of the tag to associate + id = 'c6b78e57-81a2-4c5f-a11a-d96c3c664d55' # str | Tag ID tag_assignment = thousandeyes_sdk.tags.TagAssignment() # TagAssignment | aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) @@ -233,7 +233,7 @@ with thousandeyes_sdk.tags.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of the tag to associate | + **id** | **str**| Tag ID | **tag_assignment** | [**TagAssignment**](TagAssignment.md)| | **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] diff --git a/thousandeyes-sdk-tags/docs/TagsApi.md b/thousandeyes-sdk-tags/docs/TagsApi.md index b7b161675..d10519de9 100644 --- a/thousandeyes-sdk-tags/docs/TagsApi.md +++ b/thousandeyes-sdk-tags/docs/TagsApi.md @@ -211,7 +211,7 @@ configuration = thousandeyes_sdk.core.Configuration( with thousandeyes_sdk.tags.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = thousandeyes_sdk.tags.TagsApi(api_client) - id = 'c6b78e57-81a2-4c5f-a11a-d96c3c664d55' # str | ID of tag to delete + id = 'c6b78e57-81a2-4c5f-a11a-d96c3c664d55' # str | Tag ID aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) try: @@ -228,7 +228,7 @@ with thousandeyes_sdk.tags.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of tag to delete | + **id** | **str**| Tag ID | **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] ### Return type @@ -270,7 +270,7 @@ Retrieves a tag using its ID. ```python import thousandeyes_sdk.tags -from thousandeyes_sdk.tags.models.expand import Expand +from thousandeyes_sdk.tags.models.expand_tags_options import ExpandTagsOptions from thousandeyes_sdk.tags.rest import ApiException from pprint import pprint @@ -294,9 +294,9 @@ configuration = thousandeyes_sdk.core.Configuration( with thousandeyes_sdk.tags.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = thousandeyes_sdk.tags.TagsApi(api_client) - id = 'c6b78e57-81a2-4c5f-a11a-d96c3c664d55' # str | ID of tag to retrieve + id = 'c6b78e57-81a2-4c5f-a11a-d96c3c664d55' # str | Tag ID aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) - expand = [thousandeyes_sdk.tags.Expand()] # List[Expand] | Optional, to retrieve associated assignments (optional) + expand = [thousandeyes_sdk.tags.ExpandTagsOptions()] # List[ExpandTagsOptions] | Optional, to retrieve associated assignments (optional) try: # Retrieve tag @@ -312,9 +312,9 @@ with thousandeyes_sdk.tags.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of tag to retrieve | + **id** | **str**| Tag ID | **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] - **expand** | [**List[Expand]**](Expand.md)| Optional, to retrieve associated assignments | [optional] + **expand** | [**List[ExpandTagsOptions]**](ExpandTagsOptions.md)| Optional, to retrieve associated assignments | [optional] ### Return type @@ -355,7 +355,7 @@ This endpoint returns a list of tags in the specified account group (`aid`). ```python import thousandeyes_sdk.tags -from thousandeyes_sdk.tags.models.expand import Expand +from thousandeyes_sdk.tags.models.expand_tags_options import ExpandTagsOptions from thousandeyes_sdk.tags.rest import ApiException from pprint import pprint @@ -380,7 +380,7 @@ with thousandeyes_sdk.tags.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = thousandeyes_sdk.tags.TagsApi(api_client) aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) - expand = [thousandeyes_sdk.tags.Expand()] # List[Expand] | Optional, to retrieve associated assignments (optional) + expand = [thousandeyes_sdk.tags.ExpandTagsOptions()] # List[ExpandTagsOptions] | Optional, to retrieve associated assignments (optional) try: # List tags @@ -397,7 +397,7 @@ with thousandeyes_sdk.tags.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] - **expand** | [**List[Expand]**](Expand.md)| Optional, to retrieve associated assignments | [optional] + **expand** | [**List[ExpandTagsOptions]**](ExpandTagsOptions.md)| Optional, to retrieve associated assignments | [optional] ### Return type diff --git a/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/__init__.py b/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/__init__.py index f5d48bfc8..8ede9d4ad 100644 --- a/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/__init__.py +++ b/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/__init__.py @@ -27,7 +27,7 @@ from thousandeyes_sdk.tags.models.bulk_tag_assignments import BulkTagAssignments from thousandeyes_sdk.tags.models.bulk_tag_response import BulkTagResponse from thousandeyes_sdk.tags.models.error import Error -from thousandeyes_sdk.tags.models.expand import Expand +from thousandeyes_sdk.tags.models.expand_tags_options import ExpandTagsOptions from thousandeyes_sdk.tags.models.link import Link from thousandeyes_sdk.tags.models.object_type import ObjectType from thousandeyes_sdk.tags.models.self_links import SelfLinks diff --git a/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/api/tag_assignment_api.py b/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/api/tag_assignment_api.py index f21181112..b3e7ae74c 100644 --- a/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/api/tag_assignment_api.py +++ b/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/api/tag_assignment_api.py @@ -46,7 +46,7 @@ def __init__(self, api_client=None) -> None: @validate_call def assign_tag( self, - id: Annotated[StrictStr, Field(description="ID of the tag to associate")], + id: Annotated[StrictStr, Field(description="Tag ID")], tag_assignment: TagAssignment, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, _request_timeout: Union[ @@ -66,7 +66,7 @@ def assign_tag( Assigns a tag to one or more objects. This endpoint has cumulative behavior: The tag is assigned to the specified objects, and the previous assignments persist. No unassignment takes place. - :param id: ID of the tag to associate (required) + :param id: Tag ID (required) :type id: str :param tag_assignment: (required) :type tag_assignment: TagAssignment @@ -127,7 +127,7 @@ def assign_tag( @validate_call def assign_tag_with_http_info( self, - id: Annotated[StrictStr, Field(description="ID of the tag to associate")], + id: Annotated[StrictStr, Field(description="Tag ID")], tag_assignment: TagAssignment, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, _request_timeout: Union[ @@ -147,7 +147,7 @@ def assign_tag_with_http_info( Assigns a tag to one or more objects. This endpoint has cumulative behavior: The tag is assigned to the specified objects, and the previous assignments persist. No unassignment takes place. - :param id: ID of the tag to associate (required) + :param id: Tag ID (required) :type id: str :param tag_assignment: (required) :type tag_assignment: TagAssignment @@ -208,7 +208,7 @@ def assign_tag_with_http_info( @validate_call def assign_tag_without_preload_content( self, - id: Annotated[StrictStr, Field(description="ID of the tag to associate")], + id: Annotated[StrictStr, Field(description="Tag ID")], tag_assignment: TagAssignment, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, _request_timeout: Union[ @@ -228,7 +228,7 @@ def assign_tag_without_preload_content( Assigns a tag to one or more objects. This endpoint has cumulative behavior: The tag is assigned to the specified objects, and the previous assignments persist. No unassignment takes place. - :param id: ID of the tag to associate (required) + :param id: Tag ID (required) :type id: str :param tag_assignment: (required) :type tag_assignment: TagAssignment @@ -673,7 +673,7 @@ def _assign_tags_serialize( @validate_call def unassign_tag( self, - id: Annotated[StrictStr, Field(description="ID of the tag to associate")], + id: Annotated[StrictStr, Field(description="Tag ID")], tag_assignment: TagAssignment, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, _request_timeout: Union[ @@ -693,7 +693,7 @@ def unassign_tag( Removes a tag from one or more objects. - :param id: ID of the tag to associate (required) + :param id: Tag ID (required) :type id: str :param tag_assignment: (required) :type tag_assignment: TagAssignment @@ -754,7 +754,7 @@ def unassign_tag( @validate_call def unassign_tag_with_http_info( self, - id: Annotated[StrictStr, Field(description="ID of the tag to associate")], + id: Annotated[StrictStr, Field(description="Tag ID")], tag_assignment: TagAssignment, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, _request_timeout: Union[ @@ -774,7 +774,7 @@ def unassign_tag_with_http_info( Removes a tag from one or more objects. - :param id: ID of the tag to associate (required) + :param id: Tag ID (required) :type id: str :param tag_assignment: (required) :type tag_assignment: TagAssignment @@ -835,7 +835,7 @@ def unassign_tag_with_http_info( @validate_call def unassign_tag_without_preload_content( self, - id: Annotated[StrictStr, Field(description="ID of the tag to associate")], + id: Annotated[StrictStr, Field(description="Tag ID")], tag_assignment: TagAssignment, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, _request_timeout: Union[ @@ -855,7 +855,7 @@ def unassign_tag_without_preload_content( Removes a tag from one or more objects. - :param id: ID of the tag to associate (required) + :param id: Tag ID (required) :type id: str :param tag_assignment: (required) :type tag_assignment: TagAssignment diff --git a/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/api/tags_api.py b/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/api/tags_api.py index 8d51471c0..9062ebc5e 100644 --- a/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/api/tags_api.py +++ b/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/api/tags_api.py @@ -22,7 +22,7 @@ from typing import List, Optional from typing_extensions import Annotated from thousandeyes_sdk.tags.models.bulk_tag_response import BulkTagResponse -from thousandeyes_sdk.tags.models.expand import Expand +from thousandeyes_sdk.tags.models.expand_tags_options import ExpandTagsOptions from thousandeyes_sdk.tags.models.tag_info import TagInfo from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized @@ -650,7 +650,7 @@ def _create_tags_serialize( @validate_call def delete_tag( self, - id: Annotated[StrictStr, Field(description="ID of tag to delete")], + id: Annotated[StrictStr, Field(description="Tag ID")], aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, _request_timeout: Union[ None, @@ -669,7 +669,7 @@ def delete_tag( Deletes a tag. - :param id: ID of tag to delete (required) + :param id: Tag ID (required) :type id: str :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str @@ -727,7 +727,7 @@ def delete_tag( @validate_call def delete_tag_with_http_info( self, - id: Annotated[StrictStr, Field(description="ID of tag to delete")], + id: Annotated[StrictStr, Field(description="Tag ID")], aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, _request_timeout: Union[ None, @@ -746,7 +746,7 @@ def delete_tag_with_http_info( Deletes a tag. - :param id: ID of tag to delete (required) + :param id: Tag ID (required) :type id: str :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str @@ -804,7 +804,7 @@ def delete_tag_with_http_info( @validate_call def delete_tag_without_preload_content( self, - id: Annotated[StrictStr, Field(description="ID of tag to delete")], + id: Annotated[StrictStr, Field(description="Tag ID")], aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, _request_timeout: Union[ None, @@ -823,7 +823,7 @@ def delete_tag_without_preload_content( Deletes a tag. - :param id: ID of tag to delete (required) + :param id: Tag ID (required) :type id: str :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str @@ -943,9 +943,9 @@ def _delete_tag_serialize( @validate_call def get_tag( self, - id: Annotated[StrictStr, Field(description="ID of tag to retrieve")], + id: Annotated[StrictStr, Field(description="Tag ID")], aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Optional, to retrieve associated assignments")] = None, + expand: Annotated[Optional[List[ExpandTagsOptions]], Field(description="Optional, to retrieve associated assignments")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -963,12 +963,12 @@ def get_tag( Retrieves a tag using its ID. - :param id: ID of tag to retrieve (required) + :param id: Tag ID (required) :type id: str :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Optional, to retrieve associated assignments - :type expand: List[Expand] + :type expand: List[ExpandTagsOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1024,9 +1024,9 @@ def get_tag( @validate_call def get_tag_with_http_info( self, - id: Annotated[StrictStr, Field(description="ID of tag to retrieve")], + id: Annotated[StrictStr, Field(description="Tag ID")], aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Optional, to retrieve associated assignments")] = None, + expand: Annotated[Optional[List[ExpandTagsOptions]], Field(description="Optional, to retrieve associated assignments")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1044,12 +1044,12 @@ def get_tag_with_http_info( Retrieves a tag using its ID. - :param id: ID of tag to retrieve (required) + :param id: Tag ID (required) :type id: str :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Optional, to retrieve associated assignments - :type expand: List[Expand] + :type expand: List[ExpandTagsOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1105,9 +1105,9 @@ def get_tag_with_http_info( @validate_call def get_tag_without_preload_content( self, - id: Annotated[StrictStr, Field(description="ID of tag to retrieve")], + id: Annotated[StrictStr, Field(description="Tag ID")], aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Optional, to retrieve associated assignments")] = None, + expand: Annotated[Optional[List[ExpandTagsOptions]], Field(description="Optional, to retrieve associated assignments")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1125,12 +1125,12 @@ def get_tag_without_preload_content( Retrieves a tag using its ID. - :param id: ID of tag to retrieve (required) + :param id: Tag ID (required) :type id: str :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Optional, to retrieve associated assignments - :type expand: List[Expand] + :type expand: List[ExpandTagsOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1255,7 +1255,7 @@ def _get_tag_serialize( def get_tags( self, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Optional, to retrieve associated assignments")] = None, + expand: Annotated[Optional[List[ExpandTagsOptions]], Field(description="Optional, to retrieve associated assignments")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1276,7 +1276,7 @@ def get_tags( :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Optional, to retrieve associated assignments - :type expand: List[Expand] + :type expand: List[ExpandTagsOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1332,7 +1332,7 @@ def get_tags( def get_tags_with_http_info( self, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Optional, to retrieve associated assignments")] = None, + expand: Annotated[Optional[List[ExpandTagsOptions]], Field(description="Optional, to retrieve associated assignments")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1353,7 +1353,7 @@ def get_tags_with_http_info( :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Optional, to retrieve associated assignments - :type expand: List[Expand] + :type expand: List[ExpandTagsOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1409,7 +1409,7 @@ def get_tags_with_http_info( def get_tags_without_preload_content( self, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Optional, to retrieve associated assignments")] = None, + expand: Annotated[Optional[List[ExpandTagsOptions]], Field(description="Optional, to retrieve associated assignments")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1430,7 +1430,7 @@ def get_tags_without_preload_content( :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Optional, to retrieve associated assignments - :type expand: List[Expand] + :type expand: List[ExpandTagsOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of diff --git a/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/models/__init__.py b/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/models/__init__.py index 14912661a..0a78c26b0 100644 --- a/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/models/__init__.py +++ b/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/models/__init__.py @@ -21,7 +21,7 @@ from thousandeyes_sdk.tags.models.bulk_tag_assignments import BulkTagAssignments from thousandeyes_sdk.tags.models.bulk_tag_response import BulkTagResponse from thousandeyes_sdk.tags.models.error import Error -from thousandeyes_sdk.tags.models.expand import Expand +from thousandeyes_sdk.tags.models.expand_tags_options import ExpandTagsOptions from thousandeyes_sdk.tags.models.link import Link from thousandeyes_sdk.tags.models.object_type import ObjectType from thousandeyes_sdk.tags.models.self_links import SelfLinks diff --git a/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/models/expand_tags_options.py b/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/models/expand_tags_options.py new file mode 100644 index 000000000..2887d81d6 --- /dev/null +++ b/thousandeyes-sdk-tags/src/thousandeyes_sdk/tags/models/expand_tags_options.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + Tags API + + The ThousandEyes Tags API provides a tagging system with key/value pairs. It allows you to tag assets within the ThousandEyes platform (such as agents, tests, or alert rules) with meaningful metadata. For example: `branch:sfo`, `branch:nyc`, and `team:netops`. This feature provides: * Support for automation. * Powerful and flexible reports/dashboards. * Support for third-party integrations. Things to note with the ThousandEyes Tags API: * Tags are backwards-compatible with existing labels. * Tags are separated by Tests (CEA), Agents (CEA), Endpoint Agents, Scheduled Endpoint Tests, and Reports. A single tag can only apply to one type of target object, so each tag must specify the target type of object via a `type` field. * Tags are defined in a single table so that they can be represented using a single model - `Tag`. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ExpandTagsOptions(str, Enum): + """ + ExpandTagsOptions + """ + + """ + allowed enum values + """ + ASSIGNMENTS = 'assignments' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ExpandTagsOptions from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-test-results/.openapi-generator/FILES b/thousandeyes-sdk-test-results/.openapi-generator/FILES index a31b69b1b..49ceac8fd 100644 --- a/thousandeyes-sdk-test-results/.openapi-generator/FILES +++ b/thousandeyes-sdk-test-results/.openapi-generator/FILES @@ -1,8 +1,7 @@ .openapi-generator-ignore MANIFEST.in README.md -docs/APITestMetricsApi.md -docs/Agent.md +docs/APITestResultsApi.md docs/ApiDetailTestResult.md docs/ApiDetailTestResults.md docs/ApiRequestDetail.md @@ -16,9 +15,9 @@ docs/BgpTestResult.md docs/BgpTestResults.md docs/BgpTestRouteInformationResult.md docs/BgpTestRouteInformationResults.md -docs/DNSSECTestMetricsApi.md -docs/DNSServerTestMetricsApi.md -docs/DNSTraceTestMetricsApi.md +docs/DNSSECTestResultsApi.md +docs/DNSServerTestResultsApi.md +docs/DNSTraceTestResultsApi.md docs/DnsServerTestResult.md docs/DnsServerTestResults.md docs/DnsTraceTestResult.md @@ -35,22 +34,21 @@ docs/HttpTestResultHeaders.md docs/HttpTestResults.md docs/Link.md docs/Marker.md -docs/Monitor.md -docs/NetworkBGPTestMetricsApi.md -docs/NetworkTestMetricsApi.md +docs/NetworkBGPTestResultsApi.md docs/NetworkTestResult.md docs/NetworkTestResults.md +docs/NetworkTestResultsApi.md docs/Page.md docs/PageLoadDetailTestResult.md docs/PageLoadDetailTestResults.md docs/PageLoadTestResult.md docs/PageLoadTestResults.md docs/PaginationLinks.md +docs/PathTrace.md docs/PathVisBaseTestResult.md docs/PathVisDetailTestResult.md docs/PathVisDetailTestResults.md docs/PathVisDirection.md -docs/PathVisEndpoint.md docs/PathVisHop.md docs/PathVisRoute.md docs/PathVisTestResult.md @@ -67,42 +65,43 @@ docs/TestDirection.md docs/TestInterval.md docs/TestLinks.md docs/TestResult.md +docs/TestResultAgent.md docs/TestResultAppLinks.md +docs/TestResultMonitor.md docs/TestSelfLink.md docs/TestType.md docs/UnauthorizedError.md docs/ValidationError.md docs/ValidationErrorItem.md -docs/VoiceRTPServerTestMetricsApi.md -docs/VoiceSIPServerTestMetricsApi.md -docs/WebFTPServerTestMetricsApi.md -docs/WebHTTPServerTestMetricsApi.md -docs/WebPageLoadTestMetricsApi.md +docs/VoiceRTPServerTestResultsApi.md +docs/VoiceSIPServerTestResultsApi.md +docs/WebFTPServerTestResultsApi.md +docs/WebHTTPServerTestResultsApi.md +docs/WebPageLoadTestResultsApi.md docs/WebTransactionDetailTestResult.md docs/WebTransactionDetailTestResults.md docs/WebTransactionPageDetailTestResult.md docs/WebTransactionPageDetailTestResults.md docs/WebTransactionTestResult.md docs/WebTransactionTestResults.md -docs/WebTransactionsTestMetricsApi.md +docs/WebTransactionsTestResultsApi.md pyproject.toml setup.cfg src/thousandeyes_sdk/test_results/__init__.py src/thousandeyes_sdk/test_results/api/__init__.py -src/thousandeyes_sdk/test_results/api/api_test_metrics_api.py -src/thousandeyes_sdk/test_results/api/dns_server_test_metrics_api.py -src/thousandeyes_sdk/test_results/api/dns_trace_test_metrics_api.py -src/thousandeyes_sdk/test_results/api/dnssec_test_metrics_api.py -src/thousandeyes_sdk/test_results/api/network_bgp_test_metrics_api.py -src/thousandeyes_sdk/test_results/api/network_test_metrics_api.py -src/thousandeyes_sdk/test_results/api/voice_rtp_server_test_metrics_api.py -src/thousandeyes_sdk/test_results/api/voice_sip_server_test_metrics_api.py -src/thousandeyes_sdk/test_results/api/web_ftp_server_test_metrics_api.py -src/thousandeyes_sdk/test_results/api/web_http_server_test_metrics_api.py -src/thousandeyes_sdk/test_results/api/web_page_load_test_metrics_api.py -src/thousandeyes_sdk/test_results/api/web_transactions_test_metrics_api.py +src/thousandeyes_sdk/test_results/api/api_test_results_api.py +src/thousandeyes_sdk/test_results/api/dns_server_test_results_api.py +src/thousandeyes_sdk/test_results/api/dns_trace_test_results_api.py +src/thousandeyes_sdk/test_results/api/dnssec_test_results_api.py +src/thousandeyes_sdk/test_results/api/network_bgp_test_results_api.py +src/thousandeyes_sdk/test_results/api/network_test_results_api.py +src/thousandeyes_sdk/test_results/api/voice_rtp_server_test_results_api.py +src/thousandeyes_sdk/test_results/api/voice_sip_server_test_results_api.py +src/thousandeyes_sdk/test_results/api/web_ftp_server_test_results_api.py +src/thousandeyes_sdk/test_results/api/web_http_server_test_results_api.py +src/thousandeyes_sdk/test_results/api/web_page_load_test_results_api.py +src/thousandeyes_sdk/test_results/api/web_transactions_test_results_api.py src/thousandeyes_sdk/test_results/models/__init__.py -src/thousandeyes_sdk/test_results/models/agent.py src/thousandeyes_sdk/test_results/models/api_detail_test_result.py src/thousandeyes_sdk/test_results/models/api_detail_test_results.py src/thousandeyes_sdk/test_results/models/api_request_detail.py @@ -132,7 +131,6 @@ src/thousandeyes_sdk/test_results/models/http_test_result_headers.py src/thousandeyes_sdk/test_results/models/http_test_results.py src/thousandeyes_sdk/test_results/models/link.py src/thousandeyes_sdk/test_results/models/marker.py -src/thousandeyes_sdk/test_results/models/monitor.py src/thousandeyes_sdk/test_results/models/network_test_result.py src/thousandeyes_sdk/test_results/models/network_test_results.py src/thousandeyes_sdk/test_results/models/page.py @@ -141,11 +139,11 @@ src/thousandeyes_sdk/test_results/models/page_load_detail_test_results.py src/thousandeyes_sdk/test_results/models/page_load_test_result.py src/thousandeyes_sdk/test_results/models/page_load_test_results.py src/thousandeyes_sdk/test_results/models/pagination_links.py +src/thousandeyes_sdk/test_results/models/path_trace.py src/thousandeyes_sdk/test_results/models/path_vis_base_test_result.py src/thousandeyes_sdk/test_results/models/path_vis_detail_test_result.py src/thousandeyes_sdk/test_results/models/path_vis_detail_test_results.py src/thousandeyes_sdk/test_results/models/path_vis_direction.py -src/thousandeyes_sdk/test_results/models/path_vis_endpoint.py src/thousandeyes_sdk/test_results/models/path_vis_hop.py src/thousandeyes_sdk/test_results/models/path_vis_route.py src/thousandeyes_sdk/test_results/models/path_vis_test_result.py @@ -162,7 +160,9 @@ src/thousandeyes_sdk/test_results/models/test_direction.py src/thousandeyes_sdk/test_results/models/test_interval.py src/thousandeyes_sdk/test_results/models/test_links.py src/thousandeyes_sdk/test_results/models/test_result.py +src/thousandeyes_sdk/test_results/models/test_result_agent.py src/thousandeyes_sdk/test_results/models/test_result_app_links.py +src/thousandeyes_sdk/test_results/models/test_result_monitor.py src/thousandeyes_sdk/test_results/models/test_self_link.py src/thousandeyes_sdk/test_results/models/test_type.py src/thousandeyes_sdk/test_results/models/unauthorized_error.py @@ -176,16 +176,16 @@ src/thousandeyes_sdk/test_results/models/web_transaction_test_result.py src/thousandeyes_sdk/test_results/models/web_transaction_test_results.py src/thousandeyes_sdk/test_results/py.typed test/__init__.py -test/test_api_test_metrics_api.py -test/test_dns_server_test_metrics_api.py -test/test_dns_trace_test_metrics_api.py -test/test_dnssec_test_metrics_api.py -test/test_network_bgp_test_metrics_api.py -test/test_network_test_metrics_api.py +test/test_api_test_results_api.py +test/test_dns_server_test_results_api.py +test/test_dns_trace_test_results_api.py +test/test_dnssec_test_results_api.py +test/test_network_bgp_test_results_api.py +test/test_network_test_results_api.py test/test_utils.py -test/test_voice_rtp_server_test_metrics_api.py -test/test_voice_sip_server_test_metrics_api.py -test/test_web_ftp_server_test_metrics_api.py -test/test_web_http_server_test_metrics_api.py -test/test_web_page_load_test_metrics_api.py -test/test_web_transactions_test_metrics_api.py +test/test_voice_rtp_server_test_results_api.py +test/test_voice_sip_server_test_results_api.py +test/test_web_ftp_server_test_results_api.py +test/test_web_http_server_test_results_api.py +test/test_web_page_load_test_results_api.py +test/test_web_transactions_test_results_api.py diff --git a/thousandeyes-sdk-test-results/README.md b/thousandeyes-sdk-test-results/README.md index 877983c5b..9b67ed888 100644 --- a/thousandeyes-sdk-test-results/README.md +++ b/thousandeyes-sdk-test-results/README.md @@ -3,7 +3,7 @@ Get test result metrics for Cloud and Enterprise Agent tests. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -75,7 +75,7 @@ configuration = thousandeyes_sdk.core.Configuration( # Enter a context with an instance of the API client with thousandeyes_sdk.core.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.test_results.APITestMetricsApi(api_client) + api_instance = thousandeyes_sdk.test_results.APITestResultsApi(api_client) test_id = '202701' # str | Test ID agent_id = '11' # str | Agent ID round_id = '1384309800' # str | Round ID @@ -84,10 +84,10 @@ with thousandeyes_sdk.core.ApiClient(configuration) as api_client: try: # Get API test results by agent and round api_response = api_instance.get_test_api_agent_round_results(test_id, agent_id, round_id, aid=aid) - print("The response of APITestMetricsApi->get_test_api_agent_round_results:\n") + print("The response of APITestResultsApi->get_test_api_agent_round_results:\n") pprint(api_response) except ApiException as e: - print("Exception when calling APITestMetricsApi->get_test_api_agent_round_results: %s\n" % e) + print("Exception when calling APITestResultsApi->get_test_api_agent_round_results: %s\n" % e) ``` @@ -97,31 +97,30 @@ All URIs are relative to *https://api.thousandeyes.com/v7* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*APITestMetricsApi* | [**get_test_api_agent_round_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/APITestMetricsApi.md#get_test_api_agent_round_results) | **GET** /test-results/{testId}/api/agent/{agentId}/round/{roundId} | Get API test results by agent and round -*APITestMetricsApi* | [**get_test_api_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/APITestMetricsApi.md#get_test_api_results) | **GET** /test-results/{testId}/api | Get API test results -*DNSSECTestMetricsApi* | [**get_test_dns_sec_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/DNSSECTestMetricsApi.md#get_test_dns_sec_results) | **GET** /test-results/{testId}/dnssec | Get DNSSEC test results -*DNSServerTestMetricsApi* | [**get_test_dns_server_result**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/DNSServerTestMetricsApi.md#get_test_dns_server_result) | **GET** /test-results/{testId}/dns-server/{serverId} | Get DNS server test results by server -*DNSServerTestMetricsApi* | [**get_test_dns_servers_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/DNSServerTestMetricsApi.md#get_test_dns_servers_results) | **GET** /test-results/{testId}/dns-server | Get DNS server test results -*DNSTraceTestMetricsApi* | [**get_test_dns_trace_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/DNSTraceTestMetricsApi.md#get_test_dns_trace_results) | **GET** /test-results/{testId}/dns-trace | Get DNS trace test results -*NetworkBGPTestMetricsApi* | [**get_test_bgp_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/NetworkBGPTestMetricsApi.md#get_test_bgp_results) | **GET** /test-results/{testId}/bgp | Get BGP test results -*NetworkBGPTestMetricsApi* | [**get_test_bgp_routes_prefix_round_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/NetworkBGPTestMetricsApi.md#get_test_bgp_routes_prefix_round_results) | **GET** /test-results/{testId}/bgp/routes/prefix/{prefixId}/round/{roundId} | Get BGP route test results by prefix -*NetworkTestMetricsApi* | [**get_test_network_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/NetworkTestMetricsApi.md#get_test_network_results) | **GET** /test-results/{testId}/network | Get network test results -*NetworkTestMetricsApi* | [**get_test_path_vis_agent_round_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/NetworkTestMetricsApi.md#get_test_path_vis_agent_round_results) | **GET** /test-results/{testId}/path-vis/agent/{agentId}/round/{roundId} | Get path visualization test results by agent and round -*NetworkTestMetricsApi* | [**get_test_path_vis_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/NetworkTestMetricsApi.md#get_test_path_vis_results) | **GET** /test-results/{testId}/path-vis | Get path visualization network test results -*VoiceRTPServerTestMetricsApi* | [**get_test_rtp_server_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/VoiceRTPServerTestMetricsApi.md#get_test_rtp_server_results) | **GET** /test-results/{testId}/rtp-server | Retrieve RTP server test metrics -*VoiceSIPServerTestMetricsApi* | [**get_test_sip_server_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/VoiceSIPServerTestMetricsApi.md#get_test_sip_server_results) | **GET** /test-results/{testId}/sip-server | Get SIP server test results -*WebFTPServerTestMetricsApi* | [**get_test_ftp_server_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/WebFTPServerTestMetricsApi.md#get_test_ftp_server_results) | **GET** /test-results/{testId}/ftp-server | Get FTP server test results -*WebHTTPServerTestMetricsApi* | [**get_test_http_server_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/WebHTTPServerTestMetricsApi.md#get_test_http_server_results) | **GET** /test-results/{testId}/http-server | Get HTTP server test results -*WebPageLoadTestMetricsApi* | [**get_test_page_load_agent_round_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/WebPageLoadTestMetricsApi.md#get_test_page_load_agent_round_results) | **GET** /test-results/{testId}/page-load/agent/{agentId}/round/{roundId} | Get page load server test results by agent and round -*WebPageLoadTestMetricsApi* | [**get_test_page_load_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/WebPageLoadTestMetricsApi.md#get_test_page_load_results) | **GET** /test-results/{testId}/page-load | Get page load server test results -*WebTransactionsTestMetricsApi* | [**get_test_web_transaction_agent_round_page_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/WebTransactionsTestMetricsApi.md#get_test_web_transaction_agent_round_page_results) | **GET** /test-results/{testId}/web-transactions/agent/{agentId}/round/{roundId}/page/{pageId} | Get detailed web transactions test result by agent, round, and page -*WebTransactionsTestMetricsApi* | [**get_test_web_transaction_agent_round_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/WebTransactionsTestMetricsApi.md#get_test_web_transaction_agent_round_results) | **GET** /test-results/{testId}/web-transactions/agent/{agentId}/round/{roundId} | Get web transactions test results by agent and round -*WebTransactionsTestMetricsApi* | [**get_test_web_transaction_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/WebTransactionsTestMetricsApi.md#get_test_web_transaction_results) | **GET** /test-results/{testId}/web-transactions | Get web transactions test results +*APITestResultsApi* | [**get_test_api_agent_round_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/APITestResultsApi.md#get_test_api_agent_round_results) | **GET** /test-results/{testId}/api/agent/{agentId}/round/{roundId} | Get API test results by agent and round +*APITestResultsApi* | [**get_test_api_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/APITestResultsApi.md#get_test_api_results) | **GET** /test-results/{testId}/api | Get API test results +*DNSSECTestResultsApi* | [**get_test_dns_sec_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/DNSSECTestResultsApi.md#get_test_dns_sec_results) | **GET** /test-results/{testId}/dnssec | Get DNSSEC test results +*DNSServerTestResultsApi* | [**get_test_dns_server_result**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/DNSServerTestResultsApi.md#get_test_dns_server_result) | **GET** /test-results/{testId}/dns-server/{serverId} | Get DNS server test results by server +*DNSServerTestResultsApi* | [**get_test_dns_servers_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/DNSServerTestResultsApi.md#get_test_dns_servers_results) | **GET** /test-results/{testId}/dns-server | Get DNS server test results +*DNSTraceTestResultsApi* | [**get_test_dns_trace_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/DNSTraceTestResultsApi.md#get_test_dns_trace_results) | **GET** /test-results/{testId}/dns-trace | Get DNS trace test results +*NetworkBGPTestResultsApi* | [**get_test_bgp_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/NetworkBGPTestResultsApi.md#get_test_bgp_results) | **GET** /test-results/{testId}/bgp | Get BGP test results +*NetworkBGPTestResultsApi* | [**get_test_bgp_routes_prefix_round_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/NetworkBGPTestResultsApi.md#get_test_bgp_routes_prefix_round_results) | **GET** /test-results/{testId}/bgp/routes/prefix/{prefixId}/round/{roundId} | Get BGP route test results by prefix +*NetworkTestResultsApi* | [**get_test_network_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/NetworkTestResultsApi.md#get_test_network_results) | **GET** /test-results/{testId}/network | Get network test results +*NetworkTestResultsApi* | [**get_test_path_vis_agent_round_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/NetworkTestResultsApi.md#get_test_path_vis_agent_round_results) | **GET** /test-results/{testId}/path-vis/agent/{agentId}/round/{roundId} | Get path visualization test results by agent and round +*NetworkTestResultsApi* | [**get_test_path_vis_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/NetworkTestResultsApi.md#get_test_path_vis_results) | **GET** /test-results/{testId}/path-vis | Get path visualization network test results +*VoiceRTPServerTestResultsApi* | [**get_test_rtp_server_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/VoiceRTPServerTestResultsApi.md#get_test_rtp_server_results) | **GET** /test-results/{testId}/rtp-server | Retrieve RTP server test metrics +*VoiceSIPServerTestResultsApi* | [**get_test_sip_server_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/VoiceSIPServerTestResultsApi.md#get_test_sip_server_results) | **GET** /test-results/{testId}/sip-server | Get SIP server test results +*WebFTPServerTestResultsApi* | [**get_test_ftp_server_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/WebFTPServerTestResultsApi.md#get_test_ftp_server_results) | **GET** /test-results/{testId}/ftp-server | Get FTP server test results +*WebHTTPServerTestResultsApi* | [**get_test_http_server_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/WebHTTPServerTestResultsApi.md#get_test_http_server_results) | **GET** /test-results/{testId}/http-server | Get HTTP server test results +*WebPageLoadTestResultsApi* | [**get_test_page_load_agent_round_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/WebPageLoadTestResultsApi.md#get_test_page_load_agent_round_results) | **GET** /test-results/{testId}/page-load/agent/{agentId}/round/{roundId} | Get page load server test results by agent and round +*WebPageLoadTestResultsApi* | [**get_test_page_load_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/WebPageLoadTestResultsApi.md#get_test_page_load_results) | **GET** /test-results/{testId}/page-load | Get page load server test results +*WebTransactionsTestResultsApi* | [**get_test_web_transaction_agent_round_page_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/WebTransactionsTestResultsApi.md#get_test_web_transaction_agent_round_page_results) | **GET** /test-results/{testId}/web-transactions/agent/{agentId}/round/{roundId}/page/{pageId} | Get detailed web transactions test result by agent, round, and page +*WebTransactionsTestResultsApi* | [**get_test_web_transaction_agent_round_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/WebTransactionsTestResultsApi.md#get_test_web_transaction_agent_round_results) | **GET** /test-results/{testId}/web-transactions/agent/{agentId}/round/{roundId} | Get web transactions test results by agent and round +*WebTransactionsTestResultsApi* | [**get_test_web_transaction_results**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/WebTransactionsTestResultsApi.md#get_test_web_transaction_results) | **GET** /test-results/{testId}/web-transactions | Get web transactions test results ## Documentation For Models - - [Agent](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/Agent.md) - [ApiDetailTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/ApiDetailTestResult.md) - [ApiDetailTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/ApiDetailTestResults.md) - [ApiRequestDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/ApiRequestDetail.md) @@ -151,7 +150,6 @@ Class | Method | HTTP request | Description - [HttpTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/HttpTestResults.md) - [Link](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/Link.md) - [Marker](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/Marker.md) - - [Monitor](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/Monitor.md) - [NetworkTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/NetworkTestResult.md) - [NetworkTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/NetworkTestResults.md) - [Page](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/Page.md) @@ -160,11 +158,11 @@ Class | Method | HTTP request | Description - [PageLoadTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/PageLoadTestResult.md) - [PageLoadTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/PageLoadTestResults.md) - [PaginationLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/PaginationLinks.md) + - [PathTrace](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/PathTrace.md) - [PathVisBaseTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/PathVisBaseTestResult.md) - [PathVisDetailTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/PathVisDetailTestResult.md) - [PathVisDetailTestResults](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/PathVisDetailTestResults.md) - [PathVisDirection](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/PathVisDirection.md) - - [PathVisEndpoint](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/PathVisEndpoint.md) - [PathVisHop](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/PathVisHop.md) - [PathVisRoute](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/PathVisRoute.md) - [PathVisTestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/PathVisTestResult.md) @@ -181,7 +179,9 @@ Class | Method | HTTP request | Description - [TestInterval](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/TestInterval.md) - [TestLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/TestLinks.md) - [TestResult](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/TestResult.md) + - [TestResultAgent](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/TestResultAgent.md) - [TestResultAppLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/TestResultAppLinks.md) + - [TestResultMonitor](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/TestResultMonitor.md) - [TestSelfLink](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/TestSelfLink.md) - [TestType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/TestType.md) - [UnauthorizedError](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-test-results/docs/UnauthorizedError.md) diff --git a/thousandeyes-sdk-test-results/docs/APITestResultsApi.md b/thousandeyes-sdk-test-results/docs/APITestResultsApi.md new file mode 100644 index 000000000..076008c11 --- /dev/null +++ b/thousandeyes-sdk-test-results/docs/APITestResultsApi.md @@ -0,0 +1,198 @@ +# thousandeyes_sdk.test_results.APITestResultsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_api_agent_round_results**](APITestResultsApi.md#get_test_api_agent_round_results) | **GET** /test-results/{testId}/api/agent/{agentId}/round/{roundId} | Get API test results by agent and round +[**get_test_api_results**](APITestResultsApi.md#get_test_api_results) | **GET** /test-results/{testId}/api | Get API test results + + +# **get_test_api_agent_round_results** +> ApiDetailTestResults get_test_api_agent_round_results(test_id, agent_id, round_id, aid=aid) + +Get API test results by agent and round + +Returns test results for API for a given agent and round. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.api_detail_test_results import ApiDetailTestResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.APITestResultsApi(api_client) + test_id = '202701' # str | Test ID + agent_id = '11' # str | Agent ID + round_id = '1384309800' # str | Round ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Get API test results by agent and round + api_response = api_instance.get_test_api_agent_round_results(test_id, agent_id, round_id, aid=aid) + print("The response of APITestResultsApi->get_test_api_agent_round_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling APITestResultsApi->get_test_api_agent_round_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **agent_id** | **str**| Agent ID | + **round_id** | **str**| Round ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ApiDetailTestResults**](ApiDetailTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_test_api_results** +> ApiTestResults get_test_api_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get API test results + +Returns test results for API. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.api_test_results import ApiTestResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.APITestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + + try: + # Get API test results + api_response = api_instance.get_test_api_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of APITestResultsApi->get_test_api_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling APITestResultsApi->get_test_api_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + +### Return type + +[**ApiTestResults**](ApiTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-test-results/docs/ApiDetailTestResult.md b/thousandeyes-sdk-test-results/docs/ApiDetailTestResult.md index 35cba406f..b89529c96 100644 --- a/thousandeyes-sdk-test-results/docs/ApiDetailTestResult.md +++ b/thousandeyes-sdk-test-results/docs/ApiDetailTestResult.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **api_transaction_time** | **float** | Elapsed execution time of the API steps. | [optional] [readonly] **completion** | **float** | Percentage of steps which completed successfully and passed assertions. | [optional] [readonly] **error_type** | **str** | Type of error encountered. | [optional] [readonly] diff --git a/thousandeyes-sdk-test-results/docs/ApiTestResult.md b/thousandeyes-sdk-test-results/docs/ApiTestResult.md index fa3fd22bc..86c5c49d1 100644 --- a/thousandeyes-sdk-test-results/docs/ApiTestResult.md +++ b/thousandeyes-sdk-test-results/docs/ApiTestResult.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **api_transaction_time** | **float** | Elapsed execution time of the API steps. | [optional] [readonly] **completion** | **float** | Percentage of steps which completed successfully and passed assertions. | [optional] [readonly] **error_type** | **str** | Type of error encountered. | [optional] [readonly] diff --git a/thousandeyes-sdk-test-results/docs/BgpBasicTestResult.md b/thousandeyes-sdk-test-results/docs/BgpBasicTestResult.md index 95b26e9e9..e68f4266d 100644 --- a/thousandeyes-sdk-test-results/docs/BgpBasicTestResult.md +++ b/thousandeyes-sdk-test-results/docs/BgpBasicTestResult.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] **round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] -**monitor** | [**Monitor**](Monitor.md) | | [optional] +**monitor** | [**TestResultMonitor**](TestResultMonitor.md) | | [optional] **prefix_id** | **str** | Internally tracked prefix ID. | [optional] **prefix** | **str** | Prefix being tracked. | [optional] diff --git a/thousandeyes-sdk-test-results/docs/BgpTestResult.md b/thousandeyes-sdk-test-results/docs/BgpTestResult.md index 15508c385..683c07a76 100644 --- a/thousandeyes-sdk-test-results/docs/BgpTestResult.md +++ b/thousandeyes-sdk-test-results/docs/BgpTestResult.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] **round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] -**monitor** | [**Monitor**](Monitor.md) | | [optional] +**monitor** | [**TestResultMonitor**](TestResultMonitor.md) | | [optional] **prefix_id** | **str** | Internally tracked prefix ID. | [optional] **prefix** | **str** | Prefix being tracked. | [optional] **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] diff --git a/thousandeyes-sdk-test-results/docs/BgpTestRouteInformationResult.md b/thousandeyes-sdk-test-results/docs/BgpTestRouteInformationResult.md index 42c593039..d2a9853ab 100644 --- a/thousandeyes-sdk-test-results/docs/BgpTestRouteInformationResult.md +++ b/thousandeyes-sdk-test-results/docs/BgpTestRouteInformationResult.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **var_date** | **datetime** | Data point date UTC (ISO date-time format). | [optional] [readonly] **round_id** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] -**monitor** | [**Monitor**](Monitor.md) | | [optional] +**monitor** | [**TestResultMonitor**](TestResultMonitor.md) | | [optional] **prefix_id** | **str** | Internally tracked prefix ID. | [optional] **prefix** | **str** | Prefix being tracked. | [optional] **is_active** | **bool** | Represents whether the route is active or inactive. An inactive route was an active route in the previous test round and is now superseded by another active (preferred) route. When requesting data for the test round in which a route change happened, both routes (active and inactive one) are included in the response. | [optional] diff --git a/thousandeyes-sdk-test-results/docs/DNSSECTestResultsApi.md b/thousandeyes-sdk-test-results/docs/DNSSECTestResultsApi.md new file mode 100644 index 000000000..3ee74c05d --- /dev/null +++ b/thousandeyes-sdk-test-results/docs/DNSSECTestResultsApi.md @@ -0,0 +1,105 @@ +# thousandeyes_sdk.test_results.DNSSECTestResultsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_dns_sec_results**](DNSSECTestResultsApi.md#get_test_dns_sec_results) | **GET** /test-results/{testId}/dnssec | Get DNSSEC test results + + +# **get_test_dns_sec_results** +> DnssecTestResults get_test_dns_sec_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get DNSSEC test results + +Returns the keychain validity for a record on a domain secured using DNSSEC extensions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.dnssec_test_results import DnssecTestResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.DNSSECTestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + + try: + # Get DNSSEC test results + api_response = api_instance.get_test_dns_sec_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of DNSSECTestResultsApi->get_test_dns_sec_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSSECTestResultsApi->get_test_dns_sec_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + +### Return type + +[**DnssecTestResults**](DnssecTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-test-results/docs/DNSServerTestResultsApi.md b/thousandeyes-sdk-test-results/docs/DNSServerTestResultsApi.md new file mode 100644 index 000000000..bbd0f83fc --- /dev/null +++ b/thousandeyes-sdk-test-results/docs/DNSServerTestResultsApi.md @@ -0,0 +1,204 @@ +# thousandeyes_sdk.test_results.DNSServerTestResultsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_dns_server_result**](DNSServerTestResultsApi.md#get_test_dns_server_result) | **GET** /test-results/{testId}/dns-server/{serverId} | Get DNS server test results by server +[**get_test_dns_servers_results**](DNSServerTestResultsApi.md#get_test_dns_servers_results) | **GET** /test-results/{testId}/dns-server | Get DNS server test results + + +# **get_test_dns_server_result** +> DnsServerTestResults get_test_dns_server_result(test_id, server_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get DNS server test results by server + +Returns mappings for a DNS record and resolution time to the specified server, measured from the requesting agent's point of view. This is similar to dig @server. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.dns_server_test_results import DnsServerTestResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.DNSServerTestResultsApi(api_client) + test_id = '202701' # str | Test ID + server_id = '281474976710706' # str | DNS server ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + + try: + # Get DNS server test results by server + api_response = api_instance.get_test_dns_server_result(test_id, server_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of DNSServerTestResultsApi->get_test_dns_server_result:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSServerTestResultsApi->get_test_dns_server_result: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **server_id** | **str**| DNS server ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + +### Return type + +[**DnsServerTestResults**](DnsServerTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_test_dns_servers_results** +> DnsServerTestResults get_test_dns_servers_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get DNS server test results + +Returns the mappings for a DNS record, along with the resolution time to each authoritative server, measured from the agent's point of view. Similar to dig @server. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.dns_server_test_results import DnsServerTestResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.DNSServerTestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + + try: + # Get DNS server test results + api_response = api_instance.get_test_dns_servers_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of DNSServerTestResultsApi->get_test_dns_servers_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSServerTestResultsApi->get_test_dns_servers_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + +### Return type + +[**DnsServerTestResults**](DnsServerTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-test-results/docs/DNSTraceTestResultsApi.md b/thousandeyes-sdk-test-results/docs/DNSTraceTestResultsApi.md new file mode 100644 index 000000000..29e354545 --- /dev/null +++ b/thousandeyes-sdk-test-results/docs/DNSTraceTestResultsApi.md @@ -0,0 +1,105 @@ +# thousandeyes_sdk.test_results.DNSTraceTestResultsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_dns_trace_results**](DNSTraceTestResultsApi.md#get_test_dns_trace_results) | **GET** /test-results/{testId}/dns-trace | Get DNS trace test results + + +# **get_test_dns_trace_results** +> DnsTraceTestResults get_test_dns_trace_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get DNS trace test results + +Returns a DNS record from the requesting agent's point of view. This is similar to dig +trace. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.dns_trace_test_results import DnsTraceTestResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.DNSTraceTestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + + try: + # Get DNS trace test results + api_response = api_instance.get_test_dns_trace_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of DNSTraceTestResultsApi->get_test_dns_trace_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSTraceTestResultsApi->get_test_dns_trace_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + +### Return type + +[**DnsTraceTestResults**](DnsTraceTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-test-results/docs/DnsServerTestResult.md b/thousandeyes-sdk-test-results/docs/DnsServerTestResult.md index 1ee71dab3..8218faa59 100644 --- a/thousandeyes-sdk-test-results/docs/DnsServerTestResult.md +++ b/thousandeyes-sdk-test-results/docs/DnsServerTestResult.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **server_id** | **str** | Internal ID of DNS server being tested | [optional] [readonly] **server** | **str** | Canonical name of server being tested | [optional] [readonly] **resolution_time** | **int** | How long it took to run the query against the serverow long it took to run the query against the server | [optional] [readonly] diff --git a/thousandeyes-sdk-test-results/docs/DnsTraceTestResult.md b/thousandeyes-sdk-test-results/docs/DnsTraceTestResult.md index aa3e5e4df..85cd3a0f4 100644 --- a/thousandeyes-sdk-test-results/docs/DnsTraceTestResult.md +++ b/thousandeyes-sdk-test-results/docs/DnsTraceTestResult.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **output** | **str** | Verbose output from the trace request | [optional] [readonly] **error_details** | **str** | Error details, if an error were encountered | [optional] [readonly] **queries** | **int** | How many queries were required to get to the requested result | [optional] [readonly] diff --git a/thousandeyes-sdk-test-results/docs/DnssecTestResult.md b/thousandeyes-sdk-test-results/docs/DnssecTestResult.md index a6a04097b..71e35ffc5 100644 --- a/thousandeyes-sdk-test-results/docs/DnssecTestResult.md +++ b/thousandeyes-sdk-test-results/docs/DnssecTestResult.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **is_valid** | **bool** | Indicates if keychain is valid (if false see errorDetails field) | [optional] [readonly] **error_details** | **str** | Error details, if an error were encountered | [optional] [readonly] diff --git a/thousandeyes-sdk-test-results/docs/FtpServerTestResult.md b/thousandeyes-sdk-test-results/docs/FtpServerTestResult.md index f61198b2b..669340cd2 100644 --- a/thousandeyes-sdk-test-results/docs/FtpServerTestResult.md +++ b/thousandeyes-sdk-test-results/docs/FtpServerTestResult.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **server_ip** | **str** | IP address of destination server | [optional] [readonly] **response_code** | **int** | FTP response code | [optional] [readonly] **dns_time** | **float** | Time required to resolve DNS in milliseconds | [optional] [readonly] diff --git a/thousandeyes-sdk-test-results/docs/HttpTestResult.md b/thousandeyes-sdk-test-results/docs/HttpTestResult.md index b407b8cfc..1097de394 100644 --- a/thousandeyes-sdk-test-results/docs/HttpTestResult.md +++ b/thousandeyes-sdk-test-results/docs/HttpTestResult.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **server_ip** | **str** | IP address of destination server | [optional] [readonly] **response_code** | **int** | HTTP response code | [optional] **num_redirects** | **int** | Number of redirects | [optional] diff --git a/thousandeyes-sdk-test-results/docs/NetworkBGPTestResultsApi.md b/thousandeyes-sdk-test-results/docs/NetworkBGPTestResultsApi.md new file mode 100644 index 000000000..7d228a294 --- /dev/null +++ b/thousandeyes-sdk-test-results/docs/NetworkBGPTestResultsApi.md @@ -0,0 +1,198 @@ +# thousandeyes_sdk.test_results.NetworkBGPTestResultsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_bgp_results**](NetworkBGPTestResultsApi.md#get_test_bgp_results) | **GET** /test-results/{testId}/bgp | Get BGP test results +[**get_test_bgp_routes_prefix_round_results**](NetworkBGPTestResultsApi.md#get_test_bgp_routes_prefix_round_results) | **GET** /test-results/{testId}/bgp/routes/prefix/{prefixId}/round/{roundId} | Get BGP route test results by prefix + + +# **get_test_bgp_results** +> BgpTestResults get_test_bgp_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get BGP test results + +Returns a list of BGP monitors actively monitoring the destination's target prefix. This list includes information about the prefix, its associated AS Number, and provides details regarding reachability, path updates, and any changes in the path for the target network. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.bgp_test_results import BgpTestResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.NetworkBGPTestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + + try: + # Get BGP test results + api_response = api_instance.get_test_bgp_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of NetworkBGPTestResultsApi->get_test_bgp_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkBGPTestResultsApi->get_test_bgp_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + +### Return type + +[**BgpTestResults**](BgpTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_test_bgp_routes_prefix_round_results** +> BgpTestRouteInformationResults get_test_bgp_routes_prefix_round_results(test_id, prefix_id, round_id, aid=aid) + +Get BGP route test results by prefix + +Returns an ordered list of networks crossed by a particular network prefix, including assigned monitors for the test and the paths taken to reach the destination. This is similar to revealing ASPath details found in a BGP Routing Information Base (rib) dump. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.bgp_test_route_information_results import BgpTestRouteInformationResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.NetworkBGPTestResultsApi(api_client) + test_id = '202701' # str | Test ID + prefix_id = '3789376546' # str | The ID of the prefix. You can get `prefixId` from the `/test-results/{testId}/bgp` endpoint. + round_id = '1384309800' # str | Round ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Get BGP route test results by prefix + api_response = api_instance.get_test_bgp_routes_prefix_round_results(test_id, prefix_id, round_id, aid=aid) + print("The response of NetworkBGPTestResultsApi->get_test_bgp_routes_prefix_round_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkBGPTestResultsApi->get_test_bgp_routes_prefix_round_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **prefix_id** | **str**| The ID of the prefix. You can get `prefixId` from the `/test-results/{testId}/bgp` endpoint. | + **round_id** | **str**| Round ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**BgpTestRouteInformationResults**](BgpTestRouteInformationResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-test-results/docs/NetworkTestResult.md b/thousandeyes-sdk-test-results/docs/NetworkTestResult.md index a3c45ceae..268da354d 100644 --- a/thousandeyes-sdk-test-results/docs/NetworkTestResult.md +++ b/thousandeyes-sdk-test-results/docs/NetworkTestResult.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes **max_latency** | **float** | Maximum RTT for packets sent to destination | [optional] [readonly] **min_latency** | **float** | Minimum RTT for packets sent to destination | [optional] [readonly] **packets_by_second** | **List[List[int]]** | Number of packets sent and received in a second. | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **server_ip** | **str** | IP of target server | [optional] [readonly] **server** | **str** | Target server, including port (if method used is TCP) | [optional] [readonly] **health_score** | **float** | A normalized value (0.0-1.0) representing the network connection health of the test target. Returns negative values as error codes. -1.0 indicates there was insufficient data to calculate the health score. | [optional] diff --git a/thousandeyes-sdk-test-results/docs/NetworkTestResultsApi.md b/thousandeyes-sdk-test-results/docs/NetworkTestResultsApi.md new file mode 100644 index 000000000..c58a8b418 --- /dev/null +++ b/thousandeyes-sdk-test-results/docs/NetworkTestResultsApi.md @@ -0,0 +1,304 @@ +# thousandeyes_sdk.test_results.NetworkTestResultsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_network_results**](NetworkTestResultsApi.md#get_test_network_results) | **GET** /test-results/{testId}/network | Get network test results +[**get_test_path_vis_agent_round_results**](NetworkTestResultsApi.md#get_test_path_vis_agent_round_results) | **GET** /test-results/{testId}/path-vis/agent/{agentId}/round/{roundId} | Get path visualization test results by agent and round +[**get_test_path_vis_results**](NetworkTestResultsApi.md#get_test_path_vis_results) | **GET** /test-results/{testId}/path-vis | Get path visualization network test results + + +# **get_test_network_results** +> NetworkTestResults get_test_network_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, direction=direction) + +Get network test results + +Returns network test results for every agent and round. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.network_test_results import NetworkTestResults +from thousandeyes_sdk.test_results.models.test_direction import TestDirection +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.NetworkTestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + direction = thousandeyes_sdk.test_results.TestDirection() # TestDirection | Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. (optional) + + try: + # Get network test results + api_response = api_instance.get_test_network_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, direction=direction) + print("The response of NetworkTestResultsApi->get_test_network_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkTestResultsApi->get_test_network_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + **direction** | [**TestDirection**](.md)| Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. | [optional] + +### Return type + +[**NetworkTestResults**](NetworkTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_test_path_vis_agent_round_results** +> PathVisDetailTestResults get_test_path_vis_agent_round_results(test_id, agent_id, round_id, aid=aid, direction=direction) + +Get path visualization test results by agent and round + +Returns a summary of the path trace data collected during path visualization for a given agent and round. With each attempt, three tries are made to reach the destination. The entire path is displayed in order. Bidirectional agent-to-agent tests also support the `direction` parameter. For example, if agents A, B, and C are testing agent D bidirectionally, and you want results from the route from agent A to agent D, you can use the query `direction=to-target`. For results from agent D to agent A, you can use `direction=from-target`. To get both results for both routes, query without the direction parameter. The source will always be agent A and the destination will be agent D, but the direction field will indicate which trace direction you want test results from. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.path_vis_detail_test_results import PathVisDetailTestResults +from thousandeyes_sdk.test_results.models.path_vis_direction import PathVisDirection +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.NetworkTestResultsApi(api_client) + test_id = '202701' # str | Test ID + agent_id = '11' # str | Agent ID + round_id = '1384309800' # str | Round ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + direction = thousandeyes_sdk.test_results.PathVisDirection() # PathVisDirection | Choose the direction for the metrics you want: [`from-target`, `to-target`]. This applies when you're doing bidirectional Agent-to-Agent tests. Omitting the parameter will default the results to both `from-target` and `to-target` values (bidirectional); otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. (optional) + + try: + # Get path visualization test results by agent and round + api_response = api_instance.get_test_path_vis_agent_round_results(test_id, agent_id, round_id, aid=aid, direction=direction) + print("The response of NetworkTestResultsApi->get_test_path_vis_agent_round_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkTestResultsApi->get_test_path_vis_agent_round_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **agent_id** | **str**| Agent ID | + **round_id** | **str**| Round ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **direction** | [**PathVisDirection**](.md)| Choose the direction for the metrics you want: [`from-target`, `to-target`]. This applies when you're doing bidirectional Agent-to-Agent tests. Omitting the parameter will default the results to both `from-target` and `to-target` values (bidirectional); otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. | [optional] + +### Return type + +[**PathVisDetailTestResults**](PathVisDetailTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_test_path_vis_results** +> PathVisTestResults get_test_path_vis_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, direction=direction) + +Get path visualization network test results + +Returns a summary of the path trace data collected during path visualization for a given time range. With each attempt, three tries are made to reach the destination. The entire path is displayed in order. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. Bidirectional agent-to-agent tests also support the `direction` parameter. For example, if agents A, B, and C are testing agent D bidirectionally, and you want results from the route from agent A to agent D, you can use the query `direction=to-target`. For results from agent D to agent A, you can use `direction=from-target`. To get both results for both routes, query without the direction parameter. The source will always be agent A and the destination will be agent D, but the direction field will indicate which trace direction you want test results from. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.path_vis_direction import PathVisDirection +from thousandeyes_sdk.test_results.models.path_vis_test_results import PathVisTestResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.NetworkTestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + direction = thousandeyes_sdk.test_results.PathVisDirection() # PathVisDirection | Choose the direction for the metrics you want: [`from-target`, `to-target`]. This applies when you're doing bidirectional Agent-to-Agent tests. Omitting the parameter will default the results to both `from-target` and `to-target` values (bidirectional); otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. (optional) + + try: + # Get path visualization network test results + api_response = api_instance.get_test_path_vis_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, direction=direction) + print("The response of NetworkTestResultsApi->get_test_path_vis_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NetworkTestResultsApi->get_test_path_vis_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + **direction** | [**PathVisDirection**](.md)| Choose the direction for the metrics you want: [`from-target`, `to-target`]. This applies when you're doing bidirectional Agent-to-Agent tests. Omitting the parameter will default the results to both `from-target` and `to-target` values (bidirectional); otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. | [optional] + +### Return type + +[**PathVisTestResults**](PathVisTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-test-results/docs/PageLoadDetailTestResult.md b/thousandeyes-sdk-test-results/docs/PageLoadDetailTestResult.md index 30ee3b07f..7183dd39d 100644 --- a/thousandeyes-sdk-test-results/docs/PageLoadDetailTestResult.md +++ b/thousandeyes-sdk-test-results/docs/PageLoadDetailTestResult.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **response_time** | **float** | Time to first byte in milliseconds | [optional] [readonly] **total_size** | **int** | Sum of wire size of all objects on page in bytes | [optional] [readonly] **num_objects** | **int** | Number of objects found on the page | [optional] [readonly] diff --git a/thousandeyes-sdk-test-results/docs/PageLoadTestResult.md b/thousandeyes-sdk-test-results/docs/PageLoadTestResult.md index 141fa05ae..1217130ed 100644 --- a/thousandeyes-sdk-test-results/docs/PageLoadTestResult.md +++ b/thousandeyes-sdk-test-results/docs/PageLoadTestResult.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **response_time** | **float** | Time to first byte in milliseconds | [optional] [readonly] **total_size** | **int** | Sum of wire size of all objects on page in bytes | [optional] [readonly] **num_objects** | **int** | Number of objects found on the page | [optional] [readonly] diff --git a/thousandeyes-sdk-test-results/docs/PathTrace.md b/thousandeyes-sdk-test-results/docs/PathTrace.md new file mode 100644 index 000000000..862be972e --- /dev/null +++ b/thousandeyes-sdk-test-results/docs/PathTrace.md @@ -0,0 +1,34 @@ +# PathTrace + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ip_address** | **str** | IP address of the hop | [optional] [readonly] +**mss** | **int** | Maximum segment size in bytes | [optional] [readonly] +**number_of_hops** | **int** | Number of hops for path trace to destination | [optional] [readonly] +**path_id** | **str** | Unique ID of path trace | [optional] [readonly] +**path_mtu** | **int** | MTU sizes on network from agents to the target | [optional] [readonly] +**response_time** | **int** | RTT of the path trace to the destination in milliseconds | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.test_results.models.path_trace import PathTrace + +# TODO update the JSON string below +json = "{}" +# create an instance of PathTrace from a JSON string +path_trace_instance = PathTrace.from_json(json) +# print the JSON string representation of the object +print(PathTrace.to_json()) + +# convert the object into a dict +path_trace_dict = path_trace_instance.to_dict() +# create an instance of PathTrace from a dict +path_trace_from_dict = PathTrace.from_dict(path_trace_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-test-results/docs/PathVisBaseTestResult.md b/thousandeyes-sdk-test-results/docs/PathVisBaseTestResult.md index 2179992b8..d6b0a6896 100644 --- a/thousandeyes-sdk-test-results/docs/PathVisBaseTestResult.md +++ b/thousandeyes-sdk-test-results/docs/PathVisBaseTestResult.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **server** | **str** | Target server, including port (if method used is TCP) | [optional] [readonly] **server_ip** | **str** | IP of target server | [optional] [readonly] **source_ip** | **str** | IP address of source agent | [optional] [readonly] diff --git a/thousandeyes-sdk-test-results/docs/PathVisDetailTestResult.md b/thousandeyes-sdk-test-results/docs/PathVisDetailTestResult.md index 690023b13..eed2cd1e0 100644 --- a/thousandeyes-sdk-test-results/docs/PathVisDetailTestResult.md +++ b/thousandeyes-sdk-test-results/docs/PathVisDetailTestResult.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **server** | **str** | Target server, including port (if method used is TCP) | [optional] [readonly] **server_ip** | **str** | IP of target server | [optional] [readonly] **source_ip** | **str** | IP address of source agent | [optional] [readonly] diff --git a/thousandeyes-sdk-test-results/docs/PathVisTestResult.md b/thousandeyes-sdk-test-results/docs/PathVisTestResult.md index e11b08b7a..d7a365e04 100644 --- a/thousandeyes-sdk-test-results/docs/PathVisTestResult.md +++ b/thousandeyes-sdk-test-results/docs/PathVisTestResult.md @@ -10,14 +10,14 @@ Name | Type | Description | Notes **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **server** | **str** | Target server, including port (if method used is TCP) | [optional] [readonly] **server_ip** | **str** | IP of target server | [optional] [readonly] **source_ip** | **str** | IP address of source agent | [optional] [readonly] **source_prefix** | **str** | IP prefix of source agent | [optional] [readonly] **target_is_proxy** | **bool** | Specifies whether the traces are targeting a proxy. If not set, it is considered as false. | [optional] [readonly] **direction** | [**PathVisDirection**](PathVisDirection.md) | | [optional] -**path_traces** | [**List[PathVisEndpoint]**](PathVisEndpoint.md) | Shows all iterations of path trace, with each iteration specified by a pathId | [optional] +**path_traces** | [**List[PathTrace]**](PathTrace.md) | Shows all iterations of path trace, with each iteration specified by a pathId | [optional] ## Example diff --git a/thousandeyes-sdk-test-results/docs/RtpStreamTestResult.md b/thousandeyes-sdk-test-results/docs/RtpStreamTestResult.md index feb3219f5..d3609a16f 100644 --- a/thousandeyes-sdk-test-results/docs/RtpStreamTestResult.md +++ b/thousandeyes-sdk-test-results/docs/RtpStreamTestResult.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **server_ip** | **str** | Target agent IP address | [optional] [readonly] **dscp** | **str** | DSCP value received by the server from the agent | [optional] [readonly] **dscp_name** | **str** | Name of DSCP value received by the server from the agent | [optional] [readonly] diff --git a/thousandeyes-sdk-test-results/docs/SipServerTestResult.md b/thousandeyes-sdk-test-results/docs/SipServerTestResult.md index c5fa16176..971f99ce2 100644 --- a/thousandeyes-sdk-test-results/docs/SipServerTestResult.md +++ b/thousandeyes-sdk-test-results/docs/SipServerTestResult.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] **server_ip** | **str** | Target agent IP address | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **availability** | **float** | availability of the service | [optional] [readonly] **connect_time** | **int** | Time required to establish a TCP connection to the server in milliseconds, only available when TCP is configured as protocol | [optional] [readonly] **dns_time** | **int** | Time required to resolve DNS in milliseconds | [optional] [readonly] diff --git a/thousandeyes-sdk-test-results/docs/TestResultAgent.md b/thousandeyes-sdk-test-results/docs/TestResultAgent.md new file mode 100644 index 000000000..a63db229a --- /dev/null +++ b/thousandeyes-sdk-test-results/docs/TestResultAgent.md @@ -0,0 +1,32 @@ +# TestResultAgent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Unique agent ID | [optional] [readonly] +**agent_name** | **str** | Agent name | [optional] [readonly] +**country_id** | **str** | 2-digit ISO country code | [optional] [readonly] +**location** | **str** | Location of the agent. | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent + +# TODO update the JSON string below +json = "{}" +# create an instance of TestResultAgent from a JSON string +test_result_agent_instance = TestResultAgent.from_json(json) +# print the JSON string representation of the object +print(TestResultAgent.to_json()) + +# convert the object into a dict +test_result_agent_dict = test_result_agent_instance.to_dict() +# create an instance of TestResultAgent from a dict +test_result_agent_from_dict = TestResultAgent.from_dict(test_result_agent_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-test-results/docs/TestResultMonitor.md b/thousandeyes-sdk-test-results/docs/TestResultMonitor.md new file mode 100644 index 000000000..f0e219652 --- /dev/null +++ b/thousandeyes-sdk-test-results/docs/TestResultMonitor.md @@ -0,0 +1,31 @@ +# TestResultMonitor + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**monitor_id** | **str** | Unique monitor ID. | [optional] [readonly] +**monitor_name** | **str** | The name of the Monitor. | [optional] [readonly] +**country_id** | **str** | 2-digit ISO country code. | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.test_results.models.test_result_monitor import TestResultMonitor + +# TODO update the JSON string below +json = "{}" +# create an instance of TestResultMonitor from a JSON string +test_result_monitor_instance = TestResultMonitor.from_json(json) +# print the JSON string representation of the object +print(TestResultMonitor.to_json()) + +# convert the object into a dict +test_result_monitor_dict = test_result_monitor_instance.to_dict() +# create an instance of TestResultMonitor from a dict +test_result_monitor_from_dict = TestResultMonitor.from_dict(test_result_monitor_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-test-results/docs/VoiceRTPServerTestResultsApi.md b/thousandeyes-sdk-test-results/docs/VoiceRTPServerTestResultsApi.md new file mode 100644 index 000000000..151015048 --- /dev/null +++ b/thousandeyes-sdk-test-results/docs/VoiceRTPServerTestResultsApi.md @@ -0,0 +1,105 @@ +# thousandeyes_sdk.test_results.VoiceRTPServerTestResultsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_rtp_server_results**](VoiceRTPServerTestResultsApi.md#get_test_rtp_server_results) | **GET** /test-results/{testId}/rtp-server | Retrieve RTP server test metrics + + +# **get_test_rtp_server_results** +> RtpStreamTestResults get_test_rtp_server_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Retrieve RTP server test metrics + +Returns Voice RTP server test results. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.rtp_stream_test_results import RtpStreamTestResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.VoiceRTPServerTestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + + try: + # Retrieve RTP server test metrics + api_response = api_instance.get_test_rtp_server_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of VoiceRTPServerTestResultsApi->get_test_rtp_server_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VoiceRTPServerTestResultsApi->get_test_rtp_server_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + +### Return type + +[**RtpStreamTestResults**](RtpStreamTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-test-results/docs/VoiceSIPServerTestResultsApi.md b/thousandeyes-sdk-test-results/docs/VoiceSIPServerTestResultsApi.md new file mode 100644 index 000000000..ddefd4d37 --- /dev/null +++ b/thousandeyes-sdk-test-results/docs/VoiceSIPServerTestResultsApi.md @@ -0,0 +1,105 @@ +# thousandeyes_sdk.test_results.VoiceSIPServerTestResultsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_sip_server_results**](VoiceSIPServerTestResultsApi.md#get_test_sip_server_results) | **GET** /test-results/{testId}/sip-server | Get SIP server test results + + +# **get_test_sip_server_results** +> SipServerTestResults get_test_sip_server_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get SIP server test results + +Returns Voice SIP server test results. It returns data for each agent and each `roundId` within the selected time frame. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.sip_server_test_results import SipServerTestResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.VoiceSIPServerTestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + + try: + # Get SIP server test results + api_response = api_instance.get_test_sip_server_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of VoiceSIPServerTestResultsApi->get_test_sip_server_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VoiceSIPServerTestResultsApi->get_test_sip_server_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + +### Return type + +[**SipServerTestResults**](SipServerTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-test-results/docs/WebFTPServerTestResultsApi.md b/thousandeyes-sdk-test-results/docs/WebFTPServerTestResultsApi.md new file mode 100644 index 000000000..2d9d433b4 --- /dev/null +++ b/thousandeyes-sdk-test-results/docs/WebFTPServerTestResultsApi.md @@ -0,0 +1,105 @@ +# thousandeyes_sdk.test_results.WebFTPServerTestResultsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_ftp_server_results**](WebFTPServerTestResultsApi.md#get_test_ftp_server_results) | **GET** /test-results/{testId}/ftp-server | Get FTP server test results + + +# **get_test_ftp_server_results** +> FtpServerTestResults get_test_ftp_server_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get FTP server test results + +Returns test results for FTP server requests. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.ftp_server_test_results import FtpServerTestResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.WebFTPServerTestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + + try: + # Get FTP server test results + api_response = api_instance.get_test_ftp_server_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of WebFTPServerTestResultsApi->get_test_ftp_server_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebFTPServerTestResultsApi->get_test_ftp_server_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + +### Return type + +[**FtpServerTestResults**](FtpServerTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-test-results/docs/WebHTTPServerTestResultsApi.md b/thousandeyes-sdk-test-results/docs/WebHTTPServerTestResultsApi.md new file mode 100644 index 000000000..e5b763628 --- /dev/null +++ b/thousandeyes-sdk-test-results/docs/WebHTTPServerTestResultsApi.md @@ -0,0 +1,108 @@ +# thousandeyes_sdk.test_results.WebHTTPServerTestResultsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_http_server_results**](WebHTTPServerTestResultsApi.md#get_test_http_server_results) | **GET** /test-results/{testId}/http-server | Get HTTP server test results + + +# **get_test_http_server_results** +> HttpTestResults get_test_http_server_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, expand=expand) + +Get HTTP server test results + +Returns results for requests made over HTTP. Components include DNS, Connect, Wait, Receive, and Fetch. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.expand import Expand +from thousandeyes_sdk.test_results.models.http_test_results import HttpTestResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.WebHTTPServerTestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + expand = [thousandeyes_sdk.test_results.Expand()] # List[Expand] | This parameter lets you decide if you want to see more details about test results. By default, no extra information is shown unless you use the query parameter. For instance, if you want more info about the \"header,\" add ?expand=header to the query. (optional) + + try: + # Get HTTP server test results + api_response = api_instance.get_test_http_server_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor, expand=expand) + print("The response of WebHTTPServerTestResultsApi->get_test_http_server_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebHTTPServerTestResultsApi->get_test_http_server_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + **expand** | [**List[Expand]**](Expand.md)| This parameter lets you decide if you want to see more details about test results. By default, no extra information is shown unless you use the query parameter. For instance, if you want more info about the \"header,\" add ?expand=header to the query. | [optional] + +### Return type + +[**HttpTestResults**](HttpTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-test-results/docs/WebPageLoadTestResultsApi.md b/thousandeyes-sdk-test-results/docs/WebPageLoadTestResultsApi.md new file mode 100644 index 000000000..977cf8086 --- /dev/null +++ b/thousandeyes-sdk-test-results/docs/WebPageLoadTestResultsApi.md @@ -0,0 +1,198 @@ +# thousandeyes_sdk.test_results.WebPageLoadTestResultsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_page_load_agent_round_results**](WebPageLoadTestResultsApi.md#get_test_page_load_agent_round_results) | **GET** /test-results/{testId}/page-load/agent/{agentId}/round/{roundId} | Get page load server test results by agent and round +[**get_test_page_load_results**](WebPageLoadTestResultsApi.md#get_test_page_load_results) | **GET** /test-results/{testId}/page-load | Get page load server test results + + +# **get_test_page_load_agent_round_results** +> PageLoadDetailTestResults get_test_page_load_agent_round_results(test_id, agent_id, round_id, aid=aid) + +Get page load server test results by agent and round + +Returns test results for a given agent and round in [HAR (http archive)](http://www.softwareishard.com/blog/har-12-spec/) format. These results contain a list of components and their load times in a page load test, similar to the waterfall view for a page load test. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.page_load_detail_test_results import PageLoadDetailTestResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.WebPageLoadTestResultsApi(api_client) + test_id = '202701' # str | Test ID + agent_id = '11' # str | Agent ID + round_id = '1384309800' # str | Round ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Get page load server test results by agent and round + api_response = api_instance.get_test_page_load_agent_round_results(test_id, agent_id, round_id, aid=aid) + print("The response of WebPageLoadTestResultsApi->get_test_page_load_agent_round_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebPageLoadTestResultsApi->get_test_page_load_agent_round_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **agent_id** | **str**| Agent ID | + **round_id** | **str**| Round ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**PageLoadDetailTestResults**](PageLoadDetailTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_test_page_load_results** +> PageLoadTestResults get_test_page_load_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get page load server test results + +Returns results for page load server tests with a focus on page load times and DOM for a web page. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.page_load_test_results import PageLoadTestResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.WebPageLoadTestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + + try: + # Get page load server test results + api_response = api_instance.get_test_page_load_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of WebPageLoadTestResultsApi->get_test_page_load_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebPageLoadTestResultsApi->get_test_page_load_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + +### Return type + +[**PageLoadTestResults**](PageLoadTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-test-results/docs/WebTransactionDetailTestResult.md b/thousandeyes-sdk-test-results/docs/WebTransactionDetailTestResult.md index 2e500354d..20d830de6 100644 --- a/thousandeyes-sdk-test-results/docs/WebTransactionDetailTestResult.md +++ b/thousandeyes-sdk-test-results/docs/WebTransactionDetailTestResult.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **component_errors** | **int** | Number of components which did not successfully load | [optional] [readonly] **transaction_time** | **int** | Elapsed execution time of the web transaction script in milliseconds | [optional] [readonly] **error_type** | **str** | Type of error encountered; corresponds to phase of connection | [optional] [readonly] diff --git a/thousandeyes-sdk-test-results/docs/WebTransactionPageDetailTestResult.md b/thousandeyes-sdk-test-results/docs/WebTransactionPageDetailTestResult.md index 6f6837b79..41171439f 100644 --- a/thousandeyes-sdk-test-results/docs/WebTransactionPageDetailTestResult.md +++ b/thousandeyes-sdk-test-results/docs/WebTransactionPageDetailTestResult.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **component_errors** | **int** | Number of components which did not successfully load | [optional] [readonly] **transaction_time** | **int** | Elapsed execution time of the web transaction script in milliseconds | [optional] [readonly] **error_type** | **str** | Type of error encountered; corresponds to phase of connection | [optional] [readonly] diff --git a/thousandeyes-sdk-test-results/docs/WebTransactionTestResult.md b/thousandeyes-sdk-test-results/docs/WebTransactionTestResult.md index aa47a86df..77cb1cca8 100644 --- a/thousandeyes-sdk-test-results/docs/WebTransactionTestResult.md +++ b/thousandeyes-sdk-test-results/docs/WebTransactionTestResult.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **links** | [**TestResultAppLinks**](TestResultAppLinks.md) | | [optional] **start_time** | **int** | Epoch time (seconds) indicating the start time of the round | [optional] [readonly] **end_time** | **int** | Epoch time (seconds) indicating the end time of the round | [optional] [readonly] -**agent** | [**Agent**](Agent.md) | | [optional] +**agent** | [**TestResultAgent**](TestResultAgent.md) | | [optional] **component_errors** | **int** | Number of components which did not successfully load | [optional] [readonly] **transaction_time** | **int** | Elapsed execution time of the web transaction script in milliseconds | [optional] [readonly] **error_type** | **str** | Type of error encountered; corresponds to phase of connection | [optional] [readonly] diff --git a/thousandeyes-sdk-test-results/docs/WebTransactionsTestResultsApi.md b/thousandeyes-sdk-test-results/docs/WebTransactionsTestResultsApi.md new file mode 100644 index 000000000..392fa1248 --- /dev/null +++ b/thousandeyes-sdk-test-results/docs/WebTransactionsTestResultsApi.md @@ -0,0 +1,293 @@ +# thousandeyes_sdk.test_results.WebTransactionsTestResultsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_test_web_transaction_agent_round_page_results**](WebTransactionsTestResultsApi.md#get_test_web_transaction_agent_round_page_results) | **GET** /test-results/{testId}/web-transactions/agent/{agentId}/round/{roundId}/page/{pageId} | Get detailed web transactions test result by agent, round, and page +[**get_test_web_transaction_agent_round_results**](WebTransactionsTestResultsApi.md#get_test_web_transaction_agent_round_results) | **GET** /test-results/{testId}/web-transactions/agent/{agentId}/round/{roundId} | Get web transactions test results by agent and round +[**get_test_web_transaction_results**](WebTransactionsTestResultsApi.md#get_test_web_transaction_results) | **GET** /test-results/{testId}/web-transactions | Get web transactions test results + + +# **get_test_web_transaction_agent_round_page_results** +> WebTransactionPageDetailTestResults get_test_web_transaction_agent_round_page_results(test_id, agent_id, round_id, page_id, aid=aid) + +Get detailed web transactions test result by agent, round, and page + +Returns a page of web transaction test results for an agent and round. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.web_transaction_page_detail_test_results import WebTransactionPageDetailTestResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.WebTransactionsTestResultsApi(api_client) + test_id = '202701' # str | Test ID + agent_id = '11' # str | Agent ID + round_id = '1384309800' # str | Round ID + page_id = '281474976710706' # str | Web page ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Get detailed web transactions test result by agent, round, and page + api_response = api_instance.get_test_web_transaction_agent_round_page_results(test_id, agent_id, round_id, page_id, aid=aid) + print("The response of WebTransactionsTestResultsApi->get_test_web_transaction_agent_round_page_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebTransactionsTestResultsApi->get_test_web_transaction_agent_round_page_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **agent_id** | **str**| Agent ID | + **round_id** | **str**| Round ID | + **page_id** | **str**| Web page ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**WebTransactionPageDetailTestResults**](WebTransactionPageDetailTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_test_web_transaction_agent_round_results** +> WebTransactionDetailTestResults get_test_web_transaction_agent_round_results(test_id, agent_id, round_id, aid=aid) + +Get web transactions test results by agent and round + +Returns test results for web transactions for a given agent and round. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.web_transaction_detail_test_results import WebTransactionDetailTestResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.WebTransactionsTestResultsApi(api_client) + test_id = '202701' # str | Test ID + agent_id = '11' # str | Agent ID + round_id = '1384309800' # str | Round ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Get web transactions test results by agent and round + api_response = api_instance.get_test_web_transaction_agent_round_results(test_id, agent_id, round_id, aid=aid) + print("The response of WebTransactionsTestResultsApi->get_test_web_transaction_agent_round_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebTransactionsTestResultsApi->get_test_web_transaction_agent_round_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **agent_id** | **str**| Agent ID | + **round_id** | **str**| Round ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**WebTransactionDetailTestResults**](WebTransactionDetailTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_test_web_transaction_results** +> WebTransactionTestResults get_test_web_transaction_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +Get web transactions test results + +Returns test results for web transactions. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.test_results +from thousandeyes_sdk.test_results.models.web_transaction_test_results import WebTransactionTestResults +from thousandeyes_sdk.test_results.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.test_results.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.test_results.WebTransactionsTestResultsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + + try: + # Get web transactions test results + api_response = api_instance.get_test_web_transaction_results(test_id, aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of WebTransactionsTestResultsApi->get_test_web_transaction_results:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebTransactionsTestResultsApi->get_test_web_transaction_results: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + +### Return type + +[**WebTransactionTestResults**](WebTransactionTestResults.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/__init__.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/__init__.py index e81c4eaab..8d9093a3c 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/__init__.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/__init__.py @@ -14,22 +14,21 @@ # import apis into sdk package -from thousandeyes_sdk.test_results.api.api_test_metrics_api import APITestMetricsApi -from thousandeyes_sdk.test_results.api.dnssec_test_metrics_api import DNSSECTestMetricsApi -from thousandeyes_sdk.test_results.api.dns_server_test_metrics_api import DNSServerTestMetricsApi -from thousandeyes_sdk.test_results.api.dns_trace_test_metrics_api import DNSTraceTestMetricsApi -from thousandeyes_sdk.test_results.api.network_bgp_test_metrics_api import NetworkBGPTestMetricsApi -from thousandeyes_sdk.test_results.api.network_test_metrics_api import NetworkTestMetricsApi -from thousandeyes_sdk.test_results.api.voice_rtp_server_test_metrics_api import VoiceRTPServerTestMetricsApi -from thousandeyes_sdk.test_results.api.voice_sip_server_test_metrics_api import VoiceSIPServerTestMetricsApi -from thousandeyes_sdk.test_results.api.web_ftp_server_test_metrics_api import WebFTPServerTestMetricsApi -from thousandeyes_sdk.test_results.api.web_http_server_test_metrics_api import WebHTTPServerTestMetricsApi -from thousandeyes_sdk.test_results.api.web_page_load_test_metrics_api import WebPageLoadTestMetricsApi -from thousandeyes_sdk.test_results.api.web_transactions_test_metrics_api import WebTransactionsTestMetricsApi +from thousandeyes_sdk.test_results.api.api_test_results_api import APITestResultsApi +from thousandeyes_sdk.test_results.api.dnssec_test_results_api import DNSSECTestResultsApi +from thousandeyes_sdk.test_results.api.dns_server_test_results_api import DNSServerTestResultsApi +from thousandeyes_sdk.test_results.api.dns_trace_test_results_api import DNSTraceTestResultsApi +from thousandeyes_sdk.test_results.api.network_bgp_test_results_api import NetworkBGPTestResultsApi +from thousandeyes_sdk.test_results.api.network_test_results_api import NetworkTestResultsApi +from thousandeyes_sdk.test_results.api.voice_rtp_server_test_results_api import VoiceRTPServerTestResultsApi +from thousandeyes_sdk.test_results.api.voice_sip_server_test_results_api import VoiceSIPServerTestResultsApi +from thousandeyes_sdk.test_results.api.web_ftp_server_test_results_api import WebFTPServerTestResultsApi +from thousandeyes_sdk.test_results.api.web_http_server_test_results_api import WebHTTPServerTestResultsApi +from thousandeyes_sdk.test_results.api.web_page_load_test_results_api import WebPageLoadTestResultsApi +from thousandeyes_sdk.test_results.api.web_transactions_test_results_api import WebTransactionsTestResultsApi # import models into sdk package -from thousandeyes_sdk.test_results.models.agent import Agent from thousandeyes_sdk.test_results.models.api_detail_test_result import ApiDetailTestResult from thousandeyes_sdk.test_results.models.api_detail_test_results import ApiDetailTestResults from thousandeyes_sdk.test_results.models.api_request_detail import ApiRequestDetail @@ -59,7 +58,6 @@ from thousandeyes_sdk.test_results.models.http_test_results import HttpTestResults from thousandeyes_sdk.test_results.models.link import Link from thousandeyes_sdk.test_results.models.marker import Marker -from thousandeyes_sdk.test_results.models.monitor import Monitor from thousandeyes_sdk.test_results.models.network_test_result import NetworkTestResult from thousandeyes_sdk.test_results.models.network_test_results import NetworkTestResults from thousandeyes_sdk.test_results.models.page import Page @@ -68,11 +66,11 @@ from thousandeyes_sdk.test_results.models.page_load_test_result import PageLoadTestResult from thousandeyes_sdk.test_results.models.page_load_test_results import PageLoadTestResults from thousandeyes_sdk.test_results.models.pagination_links import PaginationLinks +from thousandeyes_sdk.test_results.models.path_trace import PathTrace from thousandeyes_sdk.test_results.models.path_vis_base_test_result import PathVisBaseTestResult from thousandeyes_sdk.test_results.models.path_vis_detail_test_result import PathVisDetailTestResult from thousandeyes_sdk.test_results.models.path_vis_detail_test_results import PathVisDetailTestResults from thousandeyes_sdk.test_results.models.path_vis_direction import PathVisDirection -from thousandeyes_sdk.test_results.models.path_vis_endpoint import PathVisEndpoint from thousandeyes_sdk.test_results.models.path_vis_hop import PathVisHop from thousandeyes_sdk.test_results.models.path_vis_route import PathVisRoute from thousandeyes_sdk.test_results.models.path_vis_test_result import PathVisTestResult @@ -89,7 +87,9 @@ from thousandeyes_sdk.test_results.models.test_interval import TestInterval from thousandeyes_sdk.test_results.models.test_links import TestLinks from thousandeyes_sdk.test_results.models.test_result import TestResult +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks +from thousandeyes_sdk.test_results.models.test_result_monitor import TestResultMonitor from thousandeyes_sdk.test_results.models.test_self_link import TestSelfLink from thousandeyes_sdk.test_results.models.test_type import TestType from thousandeyes_sdk.test_results.models.unauthorized_error import UnauthorizedError diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/__init__.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/__init__.py index 98ab0c9cb..cfd53f1bd 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/__init__.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/__init__.py @@ -1,16 +1,16 @@ # flake8: noqa # import apis into api package -from thousandeyes_sdk.test_results.api.api_test_metrics_api import APITestMetricsApi -from thousandeyes_sdk.test_results.api.dnssec_test_metrics_api import DNSSECTestMetricsApi -from thousandeyes_sdk.test_results.api.dns_server_test_metrics_api import DNSServerTestMetricsApi -from thousandeyes_sdk.test_results.api.dns_trace_test_metrics_api import DNSTraceTestMetricsApi -from thousandeyes_sdk.test_results.api.network_bgp_test_metrics_api import NetworkBGPTestMetricsApi -from thousandeyes_sdk.test_results.api.network_test_metrics_api import NetworkTestMetricsApi -from thousandeyes_sdk.test_results.api.voice_rtp_server_test_metrics_api import VoiceRTPServerTestMetricsApi -from thousandeyes_sdk.test_results.api.voice_sip_server_test_metrics_api import VoiceSIPServerTestMetricsApi -from thousandeyes_sdk.test_results.api.web_ftp_server_test_metrics_api import WebFTPServerTestMetricsApi -from thousandeyes_sdk.test_results.api.web_http_server_test_metrics_api import WebHTTPServerTestMetricsApi -from thousandeyes_sdk.test_results.api.web_page_load_test_metrics_api import WebPageLoadTestMetricsApi -from thousandeyes_sdk.test_results.api.web_transactions_test_metrics_api import WebTransactionsTestMetricsApi +from thousandeyes_sdk.test_results.api.api_test_results_api import APITestResultsApi +from thousandeyes_sdk.test_results.api.dnssec_test_results_api import DNSSECTestResultsApi +from thousandeyes_sdk.test_results.api.dns_server_test_results_api import DNSServerTestResultsApi +from thousandeyes_sdk.test_results.api.dns_trace_test_results_api import DNSTraceTestResultsApi +from thousandeyes_sdk.test_results.api.network_bgp_test_results_api import NetworkBGPTestResultsApi +from thousandeyes_sdk.test_results.api.network_test_results_api import NetworkTestResultsApi +from thousandeyes_sdk.test_results.api.voice_rtp_server_test_results_api import VoiceRTPServerTestResultsApi +from thousandeyes_sdk.test_results.api.voice_sip_server_test_results_api import VoiceSIPServerTestResultsApi +from thousandeyes_sdk.test_results.api.web_ftp_server_test_results_api import WebFTPServerTestResultsApi +from thousandeyes_sdk.test_results.api.web_http_server_test_results_api import WebHTTPServerTestResultsApi +from thousandeyes_sdk.test_results.api.web_page_load_test_results_api import WebPageLoadTestResultsApi +from thousandeyes_sdk.test_results.api.web_transactions_test_results_api import WebTransactionsTestResultsApi diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/api_test_results_api.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/api_test_results_api.py new file mode 100644 index 000000000..437e91eb1 --- /dev/null +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/api_test_results_api.py @@ -0,0 +1,760 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.test_results.models + +from datetime import datetime +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.test_results.models.api_detail_test_results import ApiDetailTestResults +from thousandeyes_sdk.test_results.models.api_test_results import ApiTestResults + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class APITestResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-test-results")) + self.api_client = api_client + + + @validate_call + def get_test_api_agent_round_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiDetailTestResults: + """Get API test results by agent and round + + Returns test results for API for a given agent and round. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_api_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiDetailTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_api_agent_round_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ApiDetailTestResults]: + """Get API test results by agent and round + + Returns test results for API for a given agent and round. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_api_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiDetailTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_api_agent_round_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get API test results by agent and round + + Returns test results for API for a given agent and round. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_api_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiDetailTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_api_agent_round_results_serialize( + self, + test_id, + agent_id, + round_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + if agent_id is not None: + _path_params['agentId'] = agent_id + if round_id is not None: + _path_params['roundId'] = round_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/api/agent/{agentId}/round/{roundId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_test_api_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiTestResults: + """Get API test results + + Returns test results for API. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_api_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_api_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ApiTestResults]: + """Get API test results + + Returns test results for API. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_api_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_api_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get API test results + + Returns test results for API. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_api_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_api_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/api', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/dns_server_test_results_api.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/dns_server_test_results_api.py new file mode 100644 index 000000000..c51e27ba1 --- /dev/null +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/dns_server_test_results_api.py @@ -0,0 +1,830 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.test_results.models + +from datetime import datetime +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.test_results.models.dns_server_test_results import DnsServerTestResults + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class DNSServerTestResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-test-results")) + self.api_client = api_client + + + @validate_call + def get_test_dns_server_result( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + server_id: Annotated[StrictStr, Field(description="DNS server ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsServerTestResults: + """Get DNS server test results by server + + Returns mappings for a DNS record and resolution time to the specified server, measured from the requesting agent's point of view. This is similar to dig @server. + + :param test_id: Test ID (required) + :type test_id: str + :param server_id: DNS server ID (required) + :type server_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_dns_server_result_serialize( + test_id=test_id, + server_id=server_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsServerTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_dns_server_result_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + server_id: Annotated[StrictStr, Field(description="DNS server ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsServerTestResults]: + """Get DNS server test results by server + + Returns mappings for a DNS record and resolution time to the specified server, measured from the requesting agent's point of view. This is similar to dig @server. + + :param test_id: Test ID (required) + :type test_id: str + :param server_id: DNS server ID (required) + :type server_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_dns_server_result_serialize( + test_id=test_id, + server_id=server_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsServerTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_dns_server_result_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + server_id: Annotated[StrictStr, Field(description="DNS server ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get DNS server test results by server + + Returns mappings for a DNS record and resolution time to the specified server, measured from the requesting agent's point of view. This is similar to dig @server. + + :param test_id: Test ID (required) + :type test_id: str + :param server_id: DNS server ID (required) + :type server_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_dns_server_result_serialize( + test_id=test_id, + server_id=server_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsServerTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_dns_server_result_serialize( + self, + test_id, + server_id, + aid, + window, + start_date, + end_date, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + if server_id is not None: + _path_params['serverId'] = server_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/dns-server/{serverId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_test_dns_servers_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsServerTestResults: + """Get DNS server test results + + Returns the mappings for a DNS record, along with the resolution time to each authoritative server, measured from the agent's point of view. Similar to dig @server. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_dns_servers_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsServerTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_dns_servers_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsServerTestResults]: + """Get DNS server test results + + Returns the mappings for a DNS record, along with the resolution time to each authoritative server, measured from the agent's point of view. Similar to dig @server. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_dns_servers_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsServerTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_dns_servers_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get DNS server test results + + Returns the mappings for a DNS record, along with the resolution time to each authoritative server, measured from the agent's point of view. Similar to dig @server. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_dns_servers_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsServerTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_dns_servers_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/dns-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/dns_trace_test_results_api.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/dns_trace_test_results_api.py new file mode 100644 index 000000000..42057fe11 --- /dev/null +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/dns_trace_test_results_api.py @@ -0,0 +1,429 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.test_results.models + +from datetime import datetime +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.test_results.models.dns_trace_test_results import DnsTraceTestResults + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class DNSTraceTestResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-test-results")) + self.api_client = api_client + + + @validate_call + def get_test_dns_trace_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsTraceTestResults: + """Get DNS trace test results + + Returns a DNS record from the requesting agent's point of view. This is similar to dig +trace. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_dns_trace_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsTraceTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_dns_trace_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsTraceTestResults]: + """Get DNS trace test results + + Returns a DNS record from the requesting agent's point of view. This is similar to dig +trace. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_dns_trace_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsTraceTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_dns_trace_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get DNS trace test results + + Returns a DNS record from the requesting agent's point of view. This is similar to dig +trace. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_dns_trace_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsTraceTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_dns_trace_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/dns-trace', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/dnssec_test_results_api.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/dnssec_test_results_api.py new file mode 100644 index 000000000..6427d6762 --- /dev/null +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/dnssec_test_results_api.py @@ -0,0 +1,429 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.test_results.models + +from datetime import datetime +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.test_results.models.dnssec_test_results import DnssecTestResults + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class DNSSECTestResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-test-results")) + self.api_client = api_client + + + @validate_call + def get_test_dns_sec_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnssecTestResults: + """Get DNSSEC test results + + Returns the keychain validity for a record on a domain secured using DNSSEC extensions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_dns_sec_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnssecTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_dns_sec_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnssecTestResults]: + """Get DNSSEC test results + + Returns the keychain validity for a record on a domain secured using DNSSEC extensions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_dns_sec_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnssecTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_dns_sec_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get DNSSEC test results + + Returns the keychain validity for a record on a domain secured using DNSSEC extensions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_dns_sec_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnssecTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_dns_sec_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/dnssec', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/network_bgp_test_results_api.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/network_bgp_test_results_api.py new file mode 100644 index 000000000..f47bb5fa9 --- /dev/null +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/network_bgp_test_results_api.py @@ -0,0 +1,760 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.test_results.models + +from datetime import datetime +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.test_results.models.bgp_test_results import BgpTestResults +from thousandeyes_sdk.test_results.models.bgp_test_route_information_results import BgpTestRouteInformationResults + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class NetworkBGPTestResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-test-results")) + self.api_client = api_client + + + @validate_call + def get_test_bgp_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BgpTestResults: + """Get BGP test results + + Returns a list of BGP monitors actively monitoring the destination's target prefix. This list includes information about the prefix, its associated AS Number, and provides details regarding reachability, path updates, and any changes in the path for the target network. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_bgp_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_bgp_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BgpTestResults]: + """Get BGP test results + + Returns a list of BGP monitors actively monitoring the destination's target prefix. This list includes information about the prefix, its associated AS Number, and provides details regarding reachability, path updates, and any changes in the path for the target network. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_bgp_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_bgp_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get BGP test results + + Returns a list of BGP monitors actively monitoring the destination's target prefix. This list includes information about the prefix, its associated AS Number, and provides details regarding reachability, path updates, and any changes in the path for the target network. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_bgp_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_bgp_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/bgp', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_test_bgp_routes_prefix_round_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + prefix_id: Annotated[StrictStr, Field(description="The ID of the prefix. You can get `prefixId` from the `/test-results/{testId}/bgp` endpoint.")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BgpTestRouteInformationResults: + """Get BGP route test results by prefix + + Returns an ordered list of networks crossed by a particular network prefix, including assigned monitors for the test and the paths taken to reach the destination. This is similar to revealing ASPath details found in a BGP Routing Information Base (rib) dump. + + :param test_id: Test ID (required) + :type test_id: str + :param prefix_id: The ID of the prefix. You can get `prefixId` from the `/test-results/{testId}/bgp` endpoint. (required) + :type prefix_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_bgp_routes_prefix_round_results_serialize( + test_id=test_id, + prefix_id=prefix_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpTestRouteInformationResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_bgp_routes_prefix_round_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + prefix_id: Annotated[StrictStr, Field(description="The ID of the prefix. You can get `prefixId` from the `/test-results/{testId}/bgp` endpoint.")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BgpTestRouteInformationResults]: + """Get BGP route test results by prefix + + Returns an ordered list of networks crossed by a particular network prefix, including assigned monitors for the test and the paths taken to reach the destination. This is similar to revealing ASPath details found in a BGP Routing Information Base (rib) dump. + + :param test_id: Test ID (required) + :type test_id: str + :param prefix_id: The ID of the prefix. You can get `prefixId` from the `/test-results/{testId}/bgp` endpoint. (required) + :type prefix_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_bgp_routes_prefix_round_results_serialize( + test_id=test_id, + prefix_id=prefix_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpTestRouteInformationResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_bgp_routes_prefix_round_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + prefix_id: Annotated[StrictStr, Field(description="The ID of the prefix. You can get `prefixId` from the `/test-results/{testId}/bgp` endpoint.")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get BGP route test results by prefix + + Returns an ordered list of networks crossed by a particular network prefix, including assigned monitors for the test and the paths taken to reach the destination. This is similar to revealing ASPath details found in a BGP Routing Information Base (rib) dump. + + :param test_id: Test ID (required) + :type test_id: str + :param prefix_id: The ID of the prefix. You can get `prefixId` from the `/test-results/{testId}/bgp` endpoint. (required) + :type prefix_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_bgp_routes_prefix_round_results_serialize( + test_id=test_id, + prefix_id=prefix_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpTestRouteInformationResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_bgp_routes_prefix_round_results_serialize( + self, + test_id, + prefix_id, + round_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + if prefix_id is not None: + _path_params['prefixId'] = prefix_id + if round_id is not None: + _path_params['roundId'] = round_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/bgp/routes/prefix/{prefixId}/round/{roundId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/network_test_results_api.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/network_test_results_api.py new file mode 100644 index 000000000..1bb03e003 --- /dev/null +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/network_test_results_api.py @@ -0,0 +1,1200 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.test_results.models + +from datetime import datetime +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.test_results.models.network_test_results import NetworkTestResults +from thousandeyes_sdk.test_results.models.path_vis_detail_test_results import PathVisDetailTestResults +from thousandeyes_sdk.test_results.models.path_vis_direction import PathVisDirection +from thousandeyes_sdk.test_results.models.path_vis_test_results import PathVisTestResults +from thousandeyes_sdk.test_results.models.test_direction import TestDirection + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class NetworkTestResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-test-results")) + self.api_client = api_client + + + @validate_call + def get_test_network_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + direction: Annotated[Optional[TestDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NetworkTestResults: + """Get network test results + + Returns network test results for every agent and round. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param direction: Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: TestDirection + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_network_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NetworkTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_network_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + direction: Annotated[Optional[TestDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NetworkTestResults]: + """Get network test results + + Returns network test results for every agent and round. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param direction: Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: TestDirection + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_network_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NetworkTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_network_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + direction: Annotated[Optional[TestDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get network test results + + Returns network test results for every agent and round. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param direction: Choose the direction for the metrics you want: [`from-target`, `to-target`, `bidirectional`]. This applies when you're doing bidirectional Agent-to-Agent tests. For bidirectional data, you'll get combined results; otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: TestDirection + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_network_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NetworkTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_network_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + direction, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if direction is not None: + + _query_params.append(('direction', direction.value)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/network', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_test_path_vis_agent_round_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + direction: Annotated[Optional[PathVisDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`]. This applies when you're doing bidirectional Agent-to-Agent tests. Omitting the parameter will default the results to both `from-target` and `to-target` values (bidirectional); otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PathVisDetailTestResults: + """Get path visualization test results by agent and round + + Returns a summary of the path trace data collected during path visualization for a given agent and round. With each attempt, three tries are made to reach the destination. The entire path is displayed in order. Bidirectional agent-to-agent tests also support the `direction` parameter. For example, if agents A, B, and C are testing agent D bidirectionally, and you want results from the route from agent A to agent D, you can use the query `direction=to-target`. For results from agent D to agent A, you can use `direction=from-target`. To get both results for both routes, query without the direction parameter. The source will always be agent A and the destination will be agent D, but the direction field will indicate which trace direction you want test results from. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param direction: Choose the direction for the metrics you want: [`from-target`, `to-target`]. This applies when you're doing bidirectional Agent-to-Agent tests. Omitting the parameter will default the results to both `from-target` and `to-target` values (bidirectional); otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: PathVisDirection + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_path_vis_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisDetailTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_path_vis_agent_round_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + direction: Annotated[Optional[PathVisDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`]. This applies when you're doing bidirectional Agent-to-Agent tests. Omitting the parameter will default the results to both `from-target` and `to-target` values (bidirectional); otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PathVisDetailTestResults]: + """Get path visualization test results by agent and round + + Returns a summary of the path trace data collected during path visualization for a given agent and round. With each attempt, three tries are made to reach the destination. The entire path is displayed in order. Bidirectional agent-to-agent tests also support the `direction` parameter. For example, if agents A, B, and C are testing agent D bidirectionally, and you want results from the route from agent A to agent D, you can use the query `direction=to-target`. For results from agent D to agent A, you can use `direction=from-target`. To get both results for both routes, query without the direction parameter. The source will always be agent A and the destination will be agent D, but the direction field will indicate which trace direction you want test results from. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param direction: Choose the direction for the metrics you want: [`from-target`, `to-target`]. This applies when you're doing bidirectional Agent-to-Agent tests. Omitting the parameter will default the results to both `from-target` and `to-target` values (bidirectional); otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: PathVisDirection + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_path_vis_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisDetailTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_path_vis_agent_round_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + direction: Annotated[Optional[PathVisDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`]. This applies when you're doing bidirectional Agent-to-Agent tests. Omitting the parameter will default the results to both `from-target` and `to-target` values (bidirectional); otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get path visualization test results by agent and round + + Returns a summary of the path trace data collected during path visualization for a given agent and round. With each attempt, three tries are made to reach the destination. The entire path is displayed in order. Bidirectional agent-to-agent tests also support the `direction` parameter. For example, if agents A, B, and C are testing agent D bidirectionally, and you want results from the route from agent A to agent D, you can use the query `direction=to-target`. For results from agent D to agent A, you can use `direction=from-target`. To get both results for both routes, query without the direction parameter. The source will always be agent A and the destination will be agent D, but the direction field will indicate which trace direction you want test results from. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param direction: Choose the direction for the metrics you want: [`from-target`, `to-target`]. This applies when you're doing bidirectional Agent-to-Agent tests. Omitting the parameter will default the results to both `from-target` and `to-target` values (bidirectional); otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: PathVisDirection + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_path_vis_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisDetailTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_path_vis_agent_round_results_serialize( + self, + test_id, + agent_id, + round_id, + aid, + direction, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + if agent_id is not None: + _path_params['agentId'] = agent_id + if round_id is not None: + _path_params['roundId'] = round_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if direction is not None: + + _query_params.append(('direction', direction.value)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/path-vis/agent/{agentId}/round/{roundId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_test_path_vis_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + direction: Annotated[Optional[PathVisDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`]. This applies when you're doing bidirectional Agent-to-Agent tests. Omitting the parameter will default the results to both `from-target` and `to-target` values (bidirectional); otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PathVisTestResults: + """Get path visualization network test results + + Returns a summary of the path trace data collected during path visualization for a given time range. With each attempt, three tries are made to reach the destination. The entire path is displayed in order. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. Bidirectional agent-to-agent tests also support the `direction` parameter. For example, if agents A, B, and C are testing agent D bidirectionally, and you want results from the route from agent A to agent D, you can use the query `direction=to-target`. For results from agent D to agent A, you can use `direction=from-target`. To get both results for both routes, query without the direction parameter. The source will always be agent A and the destination will be agent D, but the direction field will indicate which trace direction you want test results from. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param direction: Choose the direction for the metrics you want: [`from-target`, `to-target`]. This applies when you're doing bidirectional Agent-to-Agent tests. Omitting the parameter will default the results to both `from-target` and `to-target` values (bidirectional); otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: PathVisDirection + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_path_vis_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_path_vis_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + direction: Annotated[Optional[PathVisDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`]. This applies when you're doing bidirectional Agent-to-Agent tests. Omitting the parameter will default the results to both `from-target` and `to-target` values (bidirectional); otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PathVisTestResults]: + """Get path visualization network test results + + Returns a summary of the path trace data collected during path visualization for a given time range. With each attempt, three tries are made to reach the destination. The entire path is displayed in order. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. Bidirectional agent-to-agent tests also support the `direction` parameter. For example, if agents A, B, and C are testing agent D bidirectionally, and you want results from the route from agent A to agent D, you can use the query `direction=to-target`. For results from agent D to agent A, you can use `direction=from-target`. To get both results for both routes, query without the direction parameter. The source will always be agent A and the destination will be agent D, but the direction field will indicate which trace direction you want test results from. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param direction: Choose the direction for the metrics you want: [`from-target`, `to-target`]. This applies when you're doing bidirectional Agent-to-Agent tests. Omitting the parameter will default the results to both `from-target` and `to-target` values (bidirectional); otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: PathVisDirection + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_path_vis_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_path_vis_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + direction: Annotated[Optional[PathVisDirection], Field(description="Choose the direction for the metrics you want: [`from-target`, `to-target`]. This applies when you're doing bidirectional Agent-to-Agent tests. Omitting the parameter will default the results to both `from-target` and `to-target` values (bidirectional); otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get path visualization network test results + + Returns a summary of the path trace data collected during path visualization for a given time range. With each attempt, three tries are made to reach the destination. The entire path is displayed in order. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. Bidirectional agent-to-agent tests also support the `direction` parameter. For example, if agents A, B, and C are testing agent D bidirectionally, and you want results from the route from agent A to agent D, you can use the query `direction=to-target`. For results from agent D to agent A, you can use `direction=from-target`. To get both results for both routes, query without the direction parameter. The source will always be agent A and the destination will be agent D, but the direction field will indicate which trace direction you want test results from. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param direction: Choose the direction for the metrics you want: [`from-target`, `to-target`]. This applies when you're doing bidirectional Agent-to-Agent tests. Omitting the parameter will default the results to both `from-target` and `to-target` values (bidirectional); otherwise, you'll get data for one direction. If you try to get unidirectional test data with an incorrect direction parameter, it will trigger an error response. + :type direction: PathVisDirection + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_path_vis_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PathVisTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_path_vis_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + direction, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if direction is not None: + + _query_params.append(('direction', direction.value)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/path-vis', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/voice_rtp_server_test_results_api.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/voice_rtp_server_test_results_api.py new file mode 100644 index 000000000..a0df42d29 --- /dev/null +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/voice_rtp_server_test_results_api.py @@ -0,0 +1,429 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.test_results.models + +from datetime import datetime +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.test_results.models.rtp_stream_test_results import RtpStreamTestResults + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class VoiceRTPServerTestResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-test-results")) + self.api_client = api_client + + + @validate_call + def get_test_rtp_server_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RtpStreamTestResults: + """Retrieve RTP server test metrics + + Returns Voice RTP server test results. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_rtp_server_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RtpStreamTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_rtp_server_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RtpStreamTestResults]: + """Retrieve RTP server test metrics + + Returns Voice RTP server test results. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_rtp_server_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RtpStreamTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_rtp_server_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve RTP server test metrics + + Returns Voice RTP server test results. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_rtp_server_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RtpStreamTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_rtp_server_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/rtp-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/voice_sip_server_test_results_api.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/voice_sip_server_test_results_api.py new file mode 100644 index 000000000..1717c1335 --- /dev/null +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/voice_sip_server_test_results_api.py @@ -0,0 +1,429 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.test_results.models + +from datetime import datetime +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.test_results.models.sip_server_test_results import SipServerTestResults + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class VoiceSIPServerTestResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-test-results")) + self.api_client = api_client + + + @validate_call + def get_test_sip_server_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SipServerTestResults: + """Get SIP server test results + + Returns Voice SIP server test results. It returns data for each agent and each `roundId` within the selected time frame. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_sip_server_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SipServerTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_sip_server_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SipServerTestResults]: + """Get SIP server test results + + Returns Voice SIP server test results. It returns data for each agent and each `roundId` within the selected time frame. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_sip_server_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SipServerTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_sip_server_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get SIP server test results + + Returns Voice SIP server test results. It returns data for each agent and each `roundId` within the selected time frame. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_sip_server_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SipServerTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_sip_server_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/sip-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/web_ftp_server_test_results_api.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/web_ftp_server_test_results_api.py new file mode 100644 index 000000000..44309e905 --- /dev/null +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/web_ftp_server_test_results_api.py @@ -0,0 +1,429 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.test_results.models + +from datetime import datetime +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.test_results.models.ftp_server_test_results import FtpServerTestResults + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class WebFTPServerTestResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-test-results")) + self.api_client = api_client + + + @validate_call + def get_test_ftp_server_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FtpServerTestResults: + """Get FTP server test results + + Returns test results for FTP server requests. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_ftp_server_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FtpServerTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_ftp_server_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FtpServerTestResults]: + """Get FTP server test results + + Returns test results for FTP server requests. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_ftp_server_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FtpServerTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_ftp_server_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get FTP server test results + + Returns test results for FTP server requests. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_ftp_server_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FtpServerTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_ftp_server_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/ftp-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/web_http_server_test_results_api.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/web_http_server_test_results_api.py new file mode 100644 index 000000000..7dcb604cc --- /dev/null +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/web_http_server_test_results_api.py @@ -0,0 +1,448 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.test_results.models + +from datetime import datetime +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.test_results.models.expand import Expand +from thousandeyes_sdk.test_results.models.http_test_results import HttpTestResults + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class WebHTTPServerTestResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-test-results")) + self.api_client = api_client + + + @validate_call + def get_test_http_server_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[Expand]], Field(description="This parameter lets you decide if you want to see more details about test results. By default, no extra information is shown unless you use the query parameter. For instance, if you want more info about the \"header,\" add ?expand=header to the query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HttpTestResults: + """Get HTTP server test results + + Returns results for requests made over HTTP. Components include DNS, Connect, Wait, Receive, and Fetch. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter lets you decide if you want to see more details about test results. By default, no extra information is shown unless you use the query parameter. For instance, if you want more info about the \"header,\" add ?expand=header to the query. + :type expand: List[Expand] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_http_server_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_http_server_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[Expand]], Field(description="This parameter lets you decide if you want to see more details about test results. By default, no extra information is shown unless you use the query parameter. For instance, if you want more info about the \"header,\" add ?expand=header to the query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HttpTestResults]: + """Get HTTP server test results + + Returns results for requests made over HTTP. Components include DNS, Connect, Wait, Receive, and Fetch. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter lets you decide if you want to see more details about test results. By default, no extra information is shown unless you use the query parameter. For instance, if you want more info about the \"header,\" add ?expand=header to the query. + :type expand: List[Expand] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_http_server_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_http_server_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[Expand]], Field(description="This parameter lets you decide if you want to see more details about test results. By default, no extra information is shown unless you use the query parameter. For instance, if you want more info about the \"header,\" add ?expand=header to the query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get HTTP server test results + + Returns results for requests made over HTTP. Components include DNS, Connect, Wait, Receive, and Fetch. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param expand: This parameter lets you decide if you want to see more details about test results. By default, no extra information is shown unless you use the query parameter. For instance, if you want more info about the \"header,\" add ?expand=header to the query. + :type expand: List[Expand] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_http_server_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_http_server_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/http-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/web_page_load_test_results_api.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/web_page_load_test_results_api.py new file mode 100644 index 000000000..05f7166fe --- /dev/null +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/web_page_load_test_results_api.py @@ -0,0 +1,760 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.test_results.models + +from datetime import datetime +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.test_results.models.page_load_detail_test_results import PageLoadDetailTestResults +from thousandeyes_sdk.test_results.models.page_load_test_results import PageLoadTestResults + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class WebPageLoadTestResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-test-results")) + self.api_client = api_client + + + @validate_call + def get_test_page_load_agent_round_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PageLoadDetailTestResults: + """Get page load server test results by agent and round + + Returns test results for a given agent and round in [HAR (http archive)](http://www.softwareishard.com/blog/har-12-spec/) format. These results contain a list of components and their load times in a page load test, similar to the waterfall view for a page load test. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_page_load_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageLoadDetailTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_page_load_agent_round_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PageLoadDetailTestResults]: + """Get page load server test results by agent and round + + Returns test results for a given agent and round in [HAR (http archive)](http://www.softwareishard.com/blog/har-12-spec/) format. These results contain a list of components and their load times in a page load test, similar to the waterfall view for a page load test. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_page_load_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageLoadDetailTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_page_load_agent_round_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get page load server test results by agent and round + + Returns test results for a given agent and round in [HAR (http archive)](http://www.softwareishard.com/blog/har-12-spec/) format. These results contain a list of components and their load times in a page load test, similar to the waterfall view for a page load test. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_page_load_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageLoadDetailTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_page_load_agent_round_results_serialize( + self, + test_id, + agent_id, + round_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + if agent_id is not None: + _path_params['agentId'] = agent_id + if round_id is not None: + _path_params['roundId'] = round_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/page-load/agent/{agentId}/round/{roundId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_test_page_load_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PageLoadTestResults: + """Get page load server test results + + Returns results for page load server tests with a focus on page load times and DOM for a web page. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_page_load_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageLoadTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_page_load_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PageLoadTestResults]: + """Get page load server test results + + Returns results for page load server tests with a focus on page load times and DOM for a web page. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_page_load_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageLoadTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_page_load_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get page load server test results + + Returns results for page load server tests with a focus on page load times and DOM for a web page. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_page_load_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageLoadTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_page_load_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/page-load', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/web_transactions_test_results_api.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/web_transactions_test_results_api.py new file mode 100644 index 000000000..0b45e393b --- /dev/null +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/api/web_transactions_test_results_api.py @@ -0,0 +1,1106 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.test_results.models + +from datetime import datetime +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.test_results.models.web_transaction_detail_test_results import WebTransactionDetailTestResults +from thousandeyes_sdk.test_results.models.web_transaction_page_detail_test_results import WebTransactionPageDetailTestResults +from thousandeyes_sdk.test_results.models.web_transaction_test_results import WebTransactionTestResults + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class WebTransactionsTestResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-test-results")) + self.api_client = api_client + + + @validate_call + def get_test_web_transaction_agent_round_page_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + page_id: Annotated[StrictStr, Field(description="Web page ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebTransactionPageDetailTestResults: + """Get detailed web transactions test result by agent, round, and page + + Returns a page of web transaction test results for an agent and round. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param page_id: Web page ID (required) + :type page_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_web_transaction_agent_round_page_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + page_id=page_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionPageDetailTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_web_transaction_agent_round_page_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + page_id: Annotated[StrictStr, Field(description="Web page ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebTransactionPageDetailTestResults]: + """Get detailed web transactions test result by agent, round, and page + + Returns a page of web transaction test results for an agent and round. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param page_id: Web page ID (required) + :type page_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_web_transaction_agent_round_page_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + page_id=page_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionPageDetailTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_web_transaction_agent_round_page_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + page_id: Annotated[StrictStr, Field(description="Web page ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get detailed web transactions test result by agent, round, and page + + Returns a page of web transaction test results for an agent and round. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param page_id: Web page ID (required) + :type page_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_web_transaction_agent_round_page_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + page_id=page_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionPageDetailTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_web_transaction_agent_round_page_results_serialize( + self, + test_id, + agent_id, + round_id, + page_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + if agent_id is not None: + _path_params['agentId'] = agent_id + if round_id is not None: + _path_params['roundId'] = round_id + if page_id is not None: + _path_params['pageId'] = page_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/web-transactions/agent/{agentId}/round/{roundId}/page/{pageId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_test_web_transaction_agent_round_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebTransactionDetailTestResults: + """Get web transactions test results by agent and round + + Returns test results for web transactions for a given agent and round. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_web_transaction_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionDetailTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_web_transaction_agent_round_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebTransactionDetailTestResults]: + """Get web transactions test results by agent and round + + Returns test results for web transactions for a given agent and round. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_web_transaction_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionDetailTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_web_transaction_agent_round_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_id: Annotated[StrictStr, Field(description="Agent ID")], + round_id: Annotated[StrictStr, Field(description="Round ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get web transactions test results by agent and round + + Returns test results for web transactions for a given agent and round. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_id: Agent ID (required) + :type agent_id: str + :param round_id: Round ID (required) + :type round_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_web_transaction_agent_round_results_serialize( + test_id=test_id, + agent_id=agent_id, + round_id=round_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionDetailTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_web_transaction_agent_round_results_serialize( + self, + test_id, + agent_id, + round_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + if agent_id is not None: + _path_params['agentId'] = agent_id + if round_id is not None: + _path_params['roundId'] = round_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/web-transactions/agent/{agentId}/round/{roundId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_test_web_transaction_results( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebTransactionTestResults: + """Get web transactions test results + + Returns test results for web transactions. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_web_transaction_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ).data + + + @validate_call + def get_test_web_transaction_results_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebTransactionTestResults]: + """Get web transactions test results + + Returns test results for web transactions. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_web_transaction_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.test_results.models, + ) + + + @validate_call + def get_test_web_transaction_results_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get web transactions test results + + Returns test results for web transactions. If you do not specify a window or a start and end date, data is displayed for the most recent testing round. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_test_web_transaction_results_serialize( + test_id=test_id, + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionTestResults", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_test_web_transaction_results_serialize( + self, + test_id, + aid, + window, + start_date, + end_date, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test-results/{testId}/web-transactions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/__init__.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/__init__.py index b3f762a8c..89d1f4eda 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/__init__.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/__init__.py @@ -13,7 +13,6 @@ # import models into model package -from thousandeyes_sdk.test_results.models.agent import Agent from thousandeyes_sdk.test_results.models.api_detail_test_result import ApiDetailTestResult from thousandeyes_sdk.test_results.models.api_detail_test_results import ApiDetailTestResults from thousandeyes_sdk.test_results.models.api_request_detail import ApiRequestDetail @@ -43,7 +42,6 @@ from thousandeyes_sdk.test_results.models.http_test_results import HttpTestResults from thousandeyes_sdk.test_results.models.link import Link from thousandeyes_sdk.test_results.models.marker import Marker -from thousandeyes_sdk.test_results.models.monitor import Monitor from thousandeyes_sdk.test_results.models.network_test_result import NetworkTestResult from thousandeyes_sdk.test_results.models.network_test_results import NetworkTestResults from thousandeyes_sdk.test_results.models.page import Page @@ -52,11 +50,11 @@ from thousandeyes_sdk.test_results.models.page_load_test_result import PageLoadTestResult from thousandeyes_sdk.test_results.models.page_load_test_results import PageLoadTestResults from thousandeyes_sdk.test_results.models.pagination_links import PaginationLinks +from thousandeyes_sdk.test_results.models.path_trace import PathTrace from thousandeyes_sdk.test_results.models.path_vis_base_test_result import PathVisBaseTestResult from thousandeyes_sdk.test_results.models.path_vis_detail_test_result import PathVisDetailTestResult from thousandeyes_sdk.test_results.models.path_vis_detail_test_results import PathVisDetailTestResults from thousandeyes_sdk.test_results.models.path_vis_direction import PathVisDirection -from thousandeyes_sdk.test_results.models.path_vis_endpoint import PathVisEndpoint from thousandeyes_sdk.test_results.models.path_vis_hop import PathVisHop from thousandeyes_sdk.test_results.models.path_vis_route import PathVisRoute from thousandeyes_sdk.test_results.models.path_vis_test_result import PathVisTestResult @@ -73,7 +71,9 @@ from thousandeyes_sdk.test_results.models.test_interval import TestInterval from thousandeyes_sdk.test_results.models.test_links import TestLinks from thousandeyes_sdk.test_results.models.test_result import TestResult +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks +from thousandeyes_sdk.test_results.models.test_result_monitor import TestResultMonitor from thousandeyes_sdk.test_results.models.test_self_link import TestSelfLink from thousandeyes_sdk.test_results.models.test_type import TestType from thousandeyes_sdk.test_results.models.unauthorized_error import UnauthorizedError diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/api_detail_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/api_detail_test_result.py index bc7b0e240..1b38cb8b9 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/api_detail_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/api_detail_test_result.py @@ -19,8 +19,8 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from thousandeyes_sdk.test_results.models.agent import Agent from thousandeyes_sdk.test_results.models.api_request_detail import ApiRequestDetail +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -34,7 +34,7 @@ class ApiDetailTestResult(BaseModel): links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None api_transaction_time: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Elapsed execution time of the API steps.", alias="apiTransactionTime") completion: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Percentage of steps which completed successfully and passed assertions.") error_type: Optional[StrictStr] = Field(default=None, description="Type of error encountered.", alias="errorType") @@ -128,7 +128,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "apiTransactionTime": obj.get("apiTransactionTime"), "completion": obj.get("completion"), "errorType": obj.get("errorType"), diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/api_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/api_test_result.py index 0f5d41a40..fb7fda1fb 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/api_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/api_test_result.py @@ -19,7 +19,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from thousandeyes_sdk.test_results.models.agent import Agent +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -33,7 +33,7 @@ class ApiTestResult(BaseModel): links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None api_transaction_time: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Elapsed execution time of the API steps.", alias="apiTransactionTime") completion: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Percentage of steps which completed successfully and passed assertions.") error_type: Optional[StrictStr] = Field(default=None, description="Type of error encountered.", alias="errorType") @@ -119,7 +119,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "apiTransactionTime": obj.get("apiTransactionTime"), "completion": obj.get("completion"), "errorType": obj.get("errorType"), diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/bgp_basic_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/bgp_basic_test_result.py index ce4b84c48..050e6c755 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/bgp_basic_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/bgp_basic_test_result.py @@ -19,8 +19,8 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.test_results.models.monitor import Monitor from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks +from thousandeyes_sdk.test_results.models.test_result_monitor import TestResultMonitor from typing import Optional, Set from typing_extensions import Self @@ -31,7 +31,7 @@ class BgpBasicTestResult(BaseModel): var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") - monitor: Optional[Monitor] = None + monitor: Optional[TestResultMonitor] = None prefix_id: Optional[StrictStr] = Field(default=None, description="Internally tracked prefix ID.", alias="prefixId") prefix: Optional[StrictStr] = Field(default=None, description="Prefix being tracked.") __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "monitor", "prefixId", "prefix"] @@ -101,7 +101,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "date": obj.get("date"), "roundId": obj.get("roundId"), "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, - "monitor": Monitor.from_dict(obj["monitor"]) if obj.get("monitor") is not None else None, + "monitor": TestResultMonitor.from_dict(obj["monitor"]) if obj.get("monitor") is not None else None, "prefixId": obj.get("prefixId"), "prefix": obj.get("prefix") }) diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/bgp_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/bgp_test_result.py index 76efb8ac7..46cb28550 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/bgp_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/bgp_test_result.py @@ -19,8 +19,8 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from thousandeyes_sdk.test_results.models.monitor import Monitor from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks +from thousandeyes_sdk.test_results.models.test_result_monitor import TestResultMonitor from typing import Optional, Set from typing_extensions import Self @@ -31,7 +31,7 @@ class BgpTestResult(BaseModel): var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") - monitor: Optional[Monitor] = None + monitor: Optional[TestResultMonitor] = None prefix_id: Optional[StrictStr] = Field(default=None, description="Internally tracked prefix ID.", alias="prefixId") prefix: Optional[StrictStr] = Field(default=None, description="Prefix being tracked.") start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") @@ -110,7 +110,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "date": obj.get("date"), "roundId": obj.get("roundId"), "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, - "monitor": Monitor.from_dict(obj["monitor"]) if obj.get("monitor") is not None else None, + "monitor": TestResultMonitor.from_dict(obj["monitor"]) if obj.get("monitor") is not None else None, "prefixId": obj.get("prefixId"), "prefix": obj.get("prefix"), "startTime": obj.get("startTime"), diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/bgp_test_route_information_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/bgp_test_route_information_result.py index 4b7ffee78..f03af2f3d 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/bgp_test_route_information_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/bgp_test_route_information_result.py @@ -20,8 +20,8 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from thousandeyes_sdk.test_results.models.bgp_hop import BgpHop -from thousandeyes_sdk.test_results.models.monitor import Monitor from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks +from thousandeyes_sdk.test_results.models.test_result_monitor import TestResultMonitor from typing import Optional, Set from typing_extensions import Self @@ -32,7 +32,7 @@ class BgpTestRouteInformationResult(BaseModel): var_date: Optional[datetime] = Field(default=None, description="Data point date UTC (ISO date-time format).", alias="date") round_id: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="roundId") links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") - monitor: Optional[Monitor] = None + monitor: Optional[TestResultMonitor] = None prefix_id: Optional[StrictStr] = Field(default=None, description="Internally tracked prefix ID.", alias="prefixId") prefix: Optional[StrictStr] = Field(default=None, description="Prefix being tracked.") is_active: Optional[StrictBool] = Field(default=None, description="Represents whether the route is active or inactive. An inactive route was an active route in the previous test round and is now superseded by another active (preferred) route. When requesting data for the test round in which a route change happened, both routes (active and inactive one) are included in the response.", alias="isActive") @@ -111,7 +111,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "date": obj.get("date"), "roundId": obj.get("roundId"), "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, - "monitor": Monitor.from_dict(obj["monitor"]) if obj.get("monitor") is not None else None, + "monitor": TestResultMonitor.from_dict(obj["monitor"]) if obj.get("monitor") is not None else None, "prefixId": obj.get("prefixId"), "prefix": obj.get("prefix"), "isActive": obj.get("isActive"), diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/dns_server_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/dns_server_test_result.py index 7a993f719..4c8387429 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/dns_server_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/dns_server_test_result.py @@ -19,7 +19,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.test_results.models.agent import Agent +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -33,7 +33,7 @@ class DnsServerTestResult(BaseModel): links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None server_id: Optional[StrictStr] = Field(default=None, description="Internal ID of DNS server being tested", alias="serverId") server: Optional[StrictStr] = Field(default=None, description="Canonical name of server being tested") resolution_time: Optional[StrictInt] = Field(default=None, description="How long it took to run the query against the serverow long it took to run the query against the server", alias="resolutionTime") @@ -122,7 +122,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "serverId": obj.get("serverId"), "server": obj.get("server"), "resolutionTime": obj.get("resolutionTime"), diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/dns_trace_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/dns_trace_test_result.py index a3ea6b90c..3544cdd68 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/dns_trace_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/dns_trace_test_result.py @@ -19,7 +19,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.test_results.models.agent import Agent +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -33,7 +33,7 @@ class DnsTraceTestResult(BaseModel): links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None output: Optional[StrictStr] = Field(default=None, description="Verbose output from the trace request") error_details: Optional[StrictStr] = Field(default=None, description="Error details, if an error were encountered", alias="errorDetails") queries: Optional[StrictInt] = Field(default=None, description="How many queries were required to get to the requested result") @@ -128,7 +128,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "output": obj.get("output"), "errorDetails": obj.get("errorDetails"), "queries": obj.get("queries"), diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/dnssec_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/dnssec_test_result.py index f64f9022d..16dbd12ca 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/dnssec_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/dnssec_test_result.py @@ -19,7 +19,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.test_results.models.agent import Agent +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -33,7 +33,7 @@ class DnssecTestResult(BaseModel): links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None is_valid: Optional[StrictBool] = Field(default=None, description="Indicates if keychain is valid (if false see errorDetails field)", alias="isValid") error_details: Optional[StrictStr] = Field(default=None, description="Error details, if an error were encountered", alias="errorDetails") __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "startTime", "endTime", "agent", "isValid", "errorDetails"] @@ -113,7 +113,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "isValid": obj.get("isValid"), "errorDetails": obj.get("errorDetails") }) diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/ftp_server_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/ftp_server_test_result.py index d326b28d2..04b5c00cf 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/ftp_server_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/ftp_server_test_result.py @@ -19,7 +19,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from thousandeyes_sdk.test_results.models.agent import Agent +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -33,7 +33,7 @@ class FtpServerTestResult(BaseModel): links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None server_ip: Optional[StrictStr] = Field(default=None, description="IP address of destination server", alias="serverIp") response_code: Optional[StrictInt] = Field(default=None, description="FTP response code", alias="responseCode") dns_time: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Time required to resolve DNS in milliseconds", alias="dnsTime") @@ -146,7 +146,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "serverIp": obj.get("serverIp"), "responseCode": obj.get("responseCode"), "dnsTime": obj.get("dnsTime"), diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/http_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/http_test_result.py index 862e88a5f..0230c654f 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/http_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/http_test_result.py @@ -19,9 +19,9 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from thousandeyes_sdk.test_results.models.agent import Agent from thousandeyes_sdk.test_results.models.http_test_result_headers import HttpTestResultHeaders from thousandeyes_sdk.test_results.models.ssl_cert import SslCert +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -35,7 +35,7 @@ class HttpTestResult(BaseModel): links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None server_ip: Optional[StrictStr] = Field(default=None, description="IP address of destination server", alias="serverIp") response_code: Optional[StrictInt] = Field(default=None, description="HTTP response code", alias="responseCode") num_redirects: Optional[StrictInt] = Field(default=None, description="Number of redirects", alias="numRedirects") @@ -145,7 +145,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "serverIp": obj.get("serverIp"), "responseCode": obj.get("responseCode"), "numRedirects": obj.get("numRedirects"), diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/network_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/network_test_result.py index 9d45cb6ff..69a140c2b 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/network_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/network_test_result.py @@ -19,8 +19,8 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from thousandeyes_sdk.test_results.models.agent import Agent from thousandeyes_sdk.test_results.models.test_direction import TestDirection +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -43,7 +43,7 @@ class NetworkTestResult(BaseModel): max_latency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum RTT for packets sent to destination", alias="maxLatency") min_latency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Minimum RTT for packets sent to destination", alias="minLatency") packets_by_second: Optional[List[List[StrictInt]]] = Field(default=None, description="Number of packets sent and received in a second.", alias="packetsBySecond") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None server_ip: Optional[StrictStr] = Field(default=None, description="IP of target server", alias="serverIp") server: Optional[StrictStr] = Field(default=None, description="Target server, including port (if method used is TCP)") health_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="A normalized value (0.0-1.0) representing the network connection health of the test target. Returns negative values as error codes. -1.0 indicates there was insufficient data to calculate the health score.", alias="healthScore") @@ -152,7 +152,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "maxLatency": obj.get("maxLatency"), "minLatency": obj.get("minLatency"), "packetsBySecond": obj.get("packetsBySecond"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "serverIp": obj.get("serverIp"), "server": obj.get("server"), "healthScore": obj.get("healthScore"), diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/page_load_detail_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/page_load_detail_test_result.py index a21968f5a..95a4866de 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/page_load_detail_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/page_load_detail_test_result.py @@ -19,7 +19,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Optional, Union -from thousandeyes_sdk.test_results.models.agent import Agent +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -33,7 +33,7 @@ class PageLoadDetailTestResult(BaseModel): links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None response_time: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Time to first byte in milliseconds", alias="responseTime") total_size: Optional[StrictInt] = Field(default=None, description="Sum of wire size of all objects on page in bytes", alias="totalSize") num_objects: Optional[StrictInt] = Field(default=None, description="Number of objects found on the page", alias="numObjects") @@ -128,7 +128,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "responseTime": obj.get("responseTime"), "totalSize": obj.get("totalSize"), "numObjects": obj.get("numObjects"), diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/page_load_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/page_load_test_result.py index 2812f308e..9fb8721c2 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/page_load_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/page_load_test_result.py @@ -19,7 +19,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Optional, Union -from thousandeyes_sdk.test_results.models.agent import Agent +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -33,7 +33,7 @@ class PageLoadTestResult(BaseModel): links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None response_time: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Time to first byte in milliseconds", alias="responseTime") total_size: Optional[StrictInt] = Field(default=None, description="Sum of wire size of all objects on page in bytes", alias="totalSize") num_objects: Optional[StrictInt] = Field(default=None, description="Number of objects found on the page", alias="numObjects") @@ -125,7 +125,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "responseTime": obj.get("responseTime"), "totalSize": obj.get("totalSize"), "numObjects": obj.get("numObjects"), diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/path_trace.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/path_trace.py new file mode 100644 index 000000000..dff3f58aa --- /dev/null +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/path_trace.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PathTrace(BaseModel): + """ + PathTrace + """ # noqa: E501 + ip_address: Optional[StrictStr] = Field(default=None, description="IP address of the hop", alias="ipAddress") + mss: Optional[StrictInt] = Field(default=None, description="Maximum segment size in bytes") + number_of_hops: Optional[StrictInt] = Field(default=None, description="Number of hops for path trace to destination", alias="numberOfHops") + path_id: Optional[StrictStr] = Field(default=None, description="Unique ID of path trace", alias="pathId") + path_mtu: Optional[StrictInt] = Field(default=None, description="MTU sizes on network from agents to the target", alias="pathMtu") + response_time: Optional[StrictInt] = Field(default=None, description="RTT of the path trace to the destination in milliseconds", alias="responseTime") + __properties: ClassVar[List[str]] = ["ipAddress", "mss", "numberOfHops", "pathId", "pathMtu", "responseTime"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PathTrace from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "ip_address", + "mss", + "number_of_hops", + "path_id", + "path_mtu", + "response_time", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PathTrace from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ipAddress": obj.get("ipAddress"), + "mss": obj.get("mss"), + "numberOfHops": obj.get("numberOfHops"), + "pathId": obj.get("pathId"), + "pathMtu": obj.get("pathMtu"), + "responseTime": obj.get("responseTime") + }) + return _obj + + diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/path_vis_base_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/path_vis_base_test_result.py index bbbb87062..b7cf520d7 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/path_vis_base_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/path_vis_base_test_result.py @@ -19,8 +19,8 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.test_results.models.agent import Agent from thousandeyes_sdk.test_results.models.path_vis_direction import PathVisDirection +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -34,7 +34,7 @@ class PathVisBaseTestResult(BaseModel): links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None server: Optional[StrictStr] = Field(default=None, description="Target server, including port (if method used is TCP)") server_ip: Optional[StrictStr] = Field(default=None, description="IP of target server", alias="serverIp") source_ip: Optional[StrictStr] = Field(default=None, description="IP address of source agent", alias="sourceIp") @@ -124,7 +124,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "server": obj.get("server"), "serverIp": obj.get("serverIp"), "sourceIp": obj.get("sourceIp"), diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/path_vis_detail_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/path_vis_detail_test_result.py index 8ec4d830c..c475f3e95 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/path_vis_detail_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/path_vis_detail_test_result.py @@ -19,9 +19,9 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.test_results.models.agent import Agent from thousandeyes_sdk.test_results.models.path_vis_direction import PathVisDirection from thousandeyes_sdk.test_results.models.path_vis_route import PathVisRoute +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -35,7 +35,7 @@ class PathVisDetailTestResult(BaseModel): links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None server: Optional[StrictStr] = Field(default=None, description="Target server, including port (if method used is TCP)") server_ip: Optional[StrictStr] = Field(default=None, description="IP of target server", alias="serverIp") source_ip: Optional[StrictStr] = Field(default=None, description="IP address of source agent", alias="sourceIp") @@ -133,7 +133,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "server": obj.get("server"), "serverIp": obj.get("serverIp"), "sourceIp": obj.get("sourceIp"), diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/path_vis_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/path_vis_test_result.py index 91dcc0ac9..daa8db6b7 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/path_vis_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/path_vis_test_result.py @@ -19,9 +19,9 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.test_results.models.agent import Agent +from thousandeyes_sdk.test_results.models.path_trace import PathTrace from thousandeyes_sdk.test_results.models.path_vis_direction import PathVisDirection -from thousandeyes_sdk.test_results.models.path_vis_endpoint import PathVisEndpoint +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -35,14 +35,14 @@ class PathVisTestResult(BaseModel): links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None server: Optional[StrictStr] = Field(default=None, description="Target server, including port (if method used is TCP)") server_ip: Optional[StrictStr] = Field(default=None, description="IP of target server", alias="serverIp") source_ip: Optional[StrictStr] = Field(default=None, description="IP address of source agent", alias="sourceIp") source_prefix: Optional[StrictStr] = Field(default=None, description="IP prefix of source agent", alias="sourcePrefix") target_is_proxy: Optional[StrictBool] = Field(default=None, description="Specifies whether the traces are targeting a proxy. If not set, it is considered as false.", alias="targetIsProxy") direction: Optional[PathVisDirection] = None - path_traces: Optional[List[PathVisEndpoint]] = Field(default=None, description="Shows all iterations of path trace, with each iteration specified by a pathId", alias="pathTraces") + path_traces: Optional[List[PathTrace]] = Field(default=None, description="Shows all iterations of path trace, with each iteration specified by a pathId", alias="pathTraces") __properties: ClassVar[List[str]] = ["date", "roundId", "_links", "startTime", "endTime", "agent", "server", "serverIp", "sourceIp", "sourcePrefix", "targetIsProxy", "direction", "pathTraces"] model_config = ConfigDict( @@ -133,14 +133,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "server": obj.get("server"), "serverIp": obj.get("serverIp"), "sourceIp": obj.get("sourceIp"), "sourcePrefix": obj.get("sourcePrefix"), "targetIsProxy": obj.get("targetIsProxy"), "direction": obj.get("direction"), - "pathTraces": [PathVisEndpoint.from_dict(_item) for _item in obj["pathTraces"]] if obj.get("pathTraces") is not None else None + "pathTraces": [PathTrace.from_dict(_item) for _item in obj["pathTraces"]] if obj.get("pathTraces") is not None else None }) return _obj diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/rtp_stream_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/rtp_stream_test_result.py index 7588f1692..037572b7f 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/rtp_stream_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/rtp_stream_test_result.py @@ -19,7 +19,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from thousandeyes_sdk.test_results.models.agent import Agent +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -33,7 +33,7 @@ class RtpStreamTestResult(BaseModel): links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None server_ip: Optional[StrictStr] = Field(default=None, description="Target agent IP address", alias="serverIp") dscp: Optional[StrictStr] = Field(default=None, description="DSCP value received by the server from the agent") dscp_name: Optional[StrictStr] = Field(default=None, description="Name of DSCP value received by the server from the agent", alias="dscpName") @@ -140,7 +140,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "serverIp": obj.get("serverIp"), "dscp": obj.get("dscp"), "dscpName": obj.get("dscpName"), diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/sip_server_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/sip_server_test_result.py index 735847db2..da244a777 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/sip_server_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/sip_server_test_result.py @@ -19,8 +19,8 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from thousandeyes_sdk.test_results.models.agent import Agent from thousandeyes_sdk.test_results.models.sip_server_error_type import SipServerErrorType +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -35,7 +35,7 @@ class SipServerTestResult(BaseModel): start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") server_ip: Optional[StrictStr] = Field(default=None, description="Target agent IP address", alias="serverIp") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None availability: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="availability of the service") connect_time: Optional[StrictInt] = Field(default=None, description="Time required to establish a TCP connection to the server in milliseconds, only available when TCP is configured as protocol", alias="connectTime") dns_time: Optional[StrictInt] = Field(default=None, description="Time required to resolve DNS in milliseconds", alias="dnsTime") @@ -155,7 +155,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), "serverIp": obj.get("serverIp"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "availability": obj.get("availability"), "connectTime": obj.get("connectTime"), "dnsTime": obj.get("dnsTime"), diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/test_result_agent.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/test_result_agent.py new file mode 100644 index 000000000..fc40e9be2 --- /dev/null +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/test_result_agent.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TestResultAgent(BaseModel): + """ + TestResultAgent + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Unique agent ID", alias="agentId") + agent_name: Optional[StrictStr] = Field(default=None, description="Agent name", alias="agentName") + country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code", alias="countryId") + location: Optional[StrictStr] = Field(default=None, description="Location of the agent.") + __properties: ClassVar[List[str]] = ["agentId", "agentName", "countryId", "location"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TestResultAgent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "agent_id", + "agent_name", + "country_id", + "location", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TestResultAgent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "agentName": obj.get("agentName"), + "countryId": obj.get("countryId"), + "location": obj.get("location") + }) + return _obj + + diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/test_result_monitor.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/test_result_monitor.py new file mode 100644 index 000000000..a4cb074d5 --- /dev/null +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/test_result_monitor.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TestResultMonitor(BaseModel): + """ + TestResultMonitor + """ # noqa: E501 + monitor_id: Optional[StrictStr] = Field(default=None, description="Unique monitor ID.", alias="monitorId") + monitor_name: Optional[StrictStr] = Field(default=None, description="The name of the Monitor.", alias="monitorName") + country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code.", alias="countryId") + __properties: ClassVar[List[str]] = ["monitorId", "monitorName", "countryId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TestResultMonitor from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "monitor_id", + "monitor_name", + "country_id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TestResultMonitor from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "monitorId": obj.get("monitorId"), + "monitorName": obj.get("monitorName"), + "countryId": obj.get("countryId") + }) + return _obj + + diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/web_transaction_detail_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/web_transaction_detail_test_result.py index 79e8f3865..77fece363 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/web_transaction_detail_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/web_transaction_detail_test_result.py @@ -19,9 +19,9 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.test_results.models.agent import Agent from thousandeyes_sdk.test_results.models.marker import Marker from thousandeyes_sdk.test_results.models.page import Page +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -35,7 +35,7 @@ class WebTransactionDetailTestResult(BaseModel): links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None component_errors: Optional[StrictInt] = Field(default=None, description="Number of components which did not successfully load", alias="componentErrors") transaction_time: Optional[StrictInt] = Field(default=None, description="Elapsed execution time of the web transaction script in milliseconds", alias="transactionTime") error_type: Optional[StrictStr] = Field(default=None, description="Type of error encountered; corresponds to phase of connection", alias="errorType") @@ -137,7 +137,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "componentErrors": obj.get("componentErrors"), "transactionTime": obj.get("transactionTime"), "errorType": obj.get("errorType"), diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/web_transaction_page_detail_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/web_transaction_page_detail_test_result.py index 7e06b9b00..94a728b2c 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/web_transaction_page_detail_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/web_transaction_page_detail_test_result.py @@ -19,9 +19,9 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.test_results.models.agent import Agent from thousandeyes_sdk.test_results.models.marker import Marker from thousandeyes_sdk.test_results.models.page import Page +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -35,7 +35,7 @@ class WebTransactionPageDetailTestResult(BaseModel): links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None component_errors: Optional[StrictInt] = Field(default=None, description="Number of components which did not successfully load", alias="componentErrors") transaction_time: Optional[StrictInt] = Field(default=None, description="Elapsed execution time of the web transaction script in milliseconds", alias="transactionTime") error_type: Optional[StrictStr] = Field(default=None, description="Type of error encountered; corresponds to phase of connection", alias="errorType") @@ -140,7 +140,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "componentErrors": obj.get("componentErrors"), "transactionTime": obj.get("transactionTime"), "errorType": obj.get("errorType"), diff --git a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/web_transaction_test_result.py b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/web_transaction_test_result.py index cc34c8089..435d0a091 100644 --- a/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/web_transaction_test_result.py +++ b/thousandeyes-sdk-test-results/src/thousandeyes_sdk/test_results/models/web_transaction_test_result.py @@ -19,7 +19,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.test_results.models.agent import Agent +from thousandeyes_sdk.test_results.models.test_result_agent import TestResultAgent from thousandeyes_sdk.test_results.models.test_result_app_links import TestResultAppLinks from typing import Optional, Set from typing_extensions import Self @@ -33,7 +33,7 @@ class WebTransactionTestResult(BaseModel): links: Optional[TestResultAppLinks] = Field(default=None, alias="_links") start_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the start time of the round", alias="startTime") end_time: Optional[StrictInt] = Field(default=None, description="Epoch time (seconds) indicating the end time of the round", alias="endTime") - agent: Optional[Agent] = None + agent: Optional[TestResultAgent] = None component_errors: Optional[StrictInt] = Field(default=None, description="Number of components which did not successfully load", alias="componentErrors") transaction_time: Optional[StrictInt] = Field(default=None, description="Elapsed execution time of the web transaction script in milliseconds", alias="transactionTime") error_type: Optional[StrictStr] = Field(default=None, description="Type of error encountered; corresponds to phase of connection", alias="errorType") @@ -119,7 +119,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestResultAppLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), - "agent": Agent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, + "agent": TestResultAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None, "componentErrors": obj.get("componentErrors"), "transactionTime": obj.get("transactionTime"), "errorType": obj.get("errorType"), diff --git a/thousandeyes-sdk-test-results/test/test_api_test_results_api.py b/thousandeyes-sdk-test-results/test/test_api_test_results_api.py new file mode 100644 index 000000000..d7050cf27 --- /dev/null +++ b/thousandeyes-sdk-test-results/test/test_api_test_results_api.py @@ -0,0 +1,389 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.test_results.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.test_results.api.api_test_results_api import APITestResultsApi + + +class TestAPITestResultsApi(unittest.TestCase): + """APITestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = APITestResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_api_agent_round_results_models_validation(self) -> None: + """Test case for get_test_api_agent_round_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "completion" : 100.0, + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "errorType" : "None", + "apiTransactionTime" : 990.1, + "startTime" : 1384309800, + "endTime" : 1384309800, + "requests" : [ { + "completion" : 100.0, + "responseTime" : 440.8, + "apiCallTime" : 900.9, + "processingTime" : 59.9, + "url" : "https://api.thousandeyes.com/v7/status", + "sendTime" : 8.1, + "receiveTime" : 224.1, + "connectTime" : 12.1, + "dnsTime" : 11.1, + "name" : "First Step to Acquire Token", + "stepNumber" : 1, + "assertions" : [ { + "hasFailed" : false, + "step" : 1 + }, { + "hasFailed" : false, + "step" : 1 + } ], + "assertErrorCount" : 0, + "blockedTime" : 49.9, + "stepTime" : 990.1, + "waitTime" : 18.1 + }, { + "completion" : 100.0, + "responseTime" : 440.8, + "apiCallTime" : 900.9, + "processingTime" : 59.9, + "url" : "https://api.thousandeyes.com/v7/status", + "sendTime" : 8.1, + "receiveTime" : 224.1, + "connectTime" : 12.1, + "dnsTime" : 11.1, + "name" : "First Step to Acquire Token", + "stepNumber" : 1, + "assertions" : [ { + "hasFailed" : false, + "step" : 1 + }, { + "hasFailed" : false, + "step" : 1 + } ], + "assertErrorCount" : 0, + "blockedTime" : 49.9, + "stepTime" : 990.1, + "waitTime" : 18.1 + } ], + "roundId" : 1384309800, + "errorDetails" : "Connection error" + }, { + "date" : "2022-07-17T22:00:54Z", + "completion" : 100.0, + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "errorType" : "None", + "apiTransactionTime" : 990.1, + "startTime" : 1384309800, + "endTime" : 1384309800, + "requests" : [ { + "completion" : 100.0, + "responseTime" : 440.8, + "apiCallTime" : 900.9, + "processingTime" : 59.9, + "url" : "https://api.thousandeyes.com/v7/status", + "sendTime" : 8.1, + "receiveTime" : 224.1, + "connectTime" : 12.1, + "dnsTime" : 11.1, + "name" : "First Step to Acquire Token", + "stepNumber" : 1, + "assertions" : [ { + "hasFailed" : false, + "step" : 1 + }, { + "hasFailed" : false, + "step" : 1 + } ], + "assertErrorCount" : 0, + "blockedTime" : 49.9, + "stepTime" : 990.1, + "waitTime" : 18.1 + }, { + "completion" : 100.0, + "responseTime" : 440.8, + "apiCallTime" : 900.9, + "processingTime" : 59.9, + "url" : "https://api.thousandeyes.com/v7/status", + "sendTime" : 8.1, + "receiveTime" : 224.1, + "connectTime" : 12.1, + "dnsTime" : 11.1, + "name" : "First Step to Acquire Token", + "stepNumber" : 1, + "assertions" : [ { + "hasFailed" : false, + "step" : 1 + }, { + "hasFailed" : false, + "step" : 1 + } ], + "assertErrorCount" : 0, + "blockedTime" : 49.9, + "stepTime" : 990.1, + "waitTime" : 18.1 + } ], + "roundId" : 1384309800, + "errorDetails" : "Connection error" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.ApiDetailTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_test_api_results_models_validation(self) -> None: + """Test case for get_test_api_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "completion" : 100.0, + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "errorType" : "None", + "apiTransactionTime" : 990.1, + "startTime" : 1384309800, + "endTime" : 1384309800, + "roundId" : 1384309800, + "errorDetails" : "Connection error" + }, { + "date" : "2022-07-17T22:00:54Z", + "completion" : 100.0, + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "errorType" : "None", + "apiTransactionTime" : 990.1, + "startTime" : 1384309800, + "endTime" : 1384309800, + "roundId" : 1384309800, + "errorDetails" : "Connection error" + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.ApiTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-test-results/test/test_dns_server_test_results_api.py b/thousandeyes-sdk-test-results/test/test_dns_server_test_results_api.py new file mode 100644 index 000000000..316d7922b --- /dev/null +++ b/thousandeyes-sdk-test-results/test/test_dns_server_test_results_api.py @@ -0,0 +1,301 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.test_results.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.test_results.api.dns_server_test_results_api import DNSServerTestResultsApi + + +class TestDNSServerTestResultsApi(unittest.TestCase): + """DNSServerTestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSServerTestResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_dns_server_result_models_validation(self) -> None: + """Test case for get_test_dns_server_result request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "server" : "a1.verisigndns.com.", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "mappings" : "208.185.7.120", + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "startTime" : 1384309800, + "endTime" : 1384309800, + "resolutionTime" : 3, + "roundId" : 1384309800, + "serverId" : "456", + "errorDetails" : "Connection error" + }, { + "date" : "2022-07-17T22:00:54Z", + "server" : "a1.verisigndns.com.", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "mappings" : "208.185.7.120", + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "startTime" : 1384309800, + "endTime" : 1384309800, + "resolutionTime" : 3, + "roundId" : 1384309800, + "serverId" : "456", + "errorDetails" : "Connection error" + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.DnsServerTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_test_dns_servers_results_models_validation(self) -> None: + """Test case for get_test_dns_servers_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "server" : "a1.verisigndns.com.", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "mappings" : "208.185.7.120", + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "startTime" : 1384309800, + "endTime" : 1384309800, + "resolutionTime" : 3, + "roundId" : 1384309800, + "serverId" : "456", + "errorDetails" : "Connection error" + }, { + "date" : "2022-07-17T22:00:54Z", + "server" : "a1.verisigndns.com.", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "mappings" : "208.185.7.120", + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "startTime" : 1384309800, + "endTime" : 1384309800, + "resolutionTime" : 3, + "roundId" : 1384309800, + "serverId" : "456", + "errorDetails" : "Connection error" + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.DnsServerTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-test-results/test/test_dns_trace_test_results_api.py b/thousandeyes-sdk-test-results/test/test_dns_trace_test_results_api.py new file mode 100644 index 000000000..88521fa58 --- /dev/null +++ b/thousandeyes-sdk-test-results/test/test_dns_trace_test_results_api.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.test_results.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.test_results.api.dns_trace_test_results_api import DNSTraceTestResultsApi + + +class TestDNSTraceTestResultsApi(unittest.TestCase): + """DNSTraceTestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSTraceTestResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_dns_trace_results_models_validation(self) -> None: + """Test case for get_test_dns_trace_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "finalServerQueried" : "a1.verisigndns.com.", + "finalQueryTime" : 178, + "queries" : 3, + "failedQueries" : 0, + "output" : "com.\\t172800\\tIN\\tNS\\ta.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\tf.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\tc.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\tb.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\td.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\te.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\tg.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\tm.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\th.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\tj.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\ti.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\tl.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\tk.gtld-servers.net.\\n;; Received 498 bytes from 199.7.91.13(d.root-servers.net.) in 119 ms\\n\\nthousandeyes.com.\\t172800\\tIN\\tNS\\ta1.verisigndns.com.\\nthousandeyes.com.\\t172800\\tIN\\tNS\\ta2.verisigndns.com.\\nthousandeyes.com.\\t172800\\tIN\\tNS\\ta3.verisigndns.com.\\nthousandeyes.com.\\t172800\\tIN\\tNS\\tu1.verisigndns.com.\\n;; Received 266 bytes from 192.5.6.30(a.gtld-servers.net.) in 178 ms\\n\\napp.thousandeyes.com.\\t300\\tIN\\tCNAME\\tweb.thousandeyes.com.\\nweb.thousandeyes.com.\\t300\\tIN\\tCNAME\\tlb-app.thousandeyes.com.\\nlb-app.thousandeyes.com.\\t3600\\tIN\\tA\\t208.185.7.120\\n;; Received 173 bytes from 209.112.113.33(a1.verisigndns.com.) in 178 ms\\n\\n", + "mappings" : "208.185.7.120", + "startTime" : 1384309800, + "endTime" : 1384309800, + "roundId" : 1384309800, + "errorDetails" : "Connection error" + }, { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "finalServerQueried" : "a1.verisigndns.com.", + "finalQueryTime" : 178, + "queries" : 3, + "failedQueries" : 0, + "output" : "com.\\t172800\\tIN\\tNS\\ta.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\tf.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\tc.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\tb.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\td.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\te.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\tg.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\tm.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\th.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\tj.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\ti.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\tl.gtld-servers.net.\\ncom.\\t172800\\tIN\\tNS\\tk.gtld-servers.net.\\n;; Received 498 bytes from 199.7.91.13(d.root-servers.net.) in 119 ms\\n\\nthousandeyes.com.\\t172800\\tIN\\tNS\\ta1.verisigndns.com.\\nthousandeyes.com.\\t172800\\tIN\\tNS\\ta2.verisigndns.com.\\nthousandeyes.com.\\t172800\\tIN\\tNS\\ta3.verisigndns.com.\\nthousandeyes.com.\\t172800\\tIN\\tNS\\tu1.verisigndns.com.\\n;; Received 266 bytes from 192.5.6.30(a.gtld-servers.net.) in 178 ms\\n\\napp.thousandeyes.com.\\t300\\tIN\\tCNAME\\tweb.thousandeyes.com.\\nweb.thousandeyes.com.\\t300\\tIN\\tCNAME\\tlb-app.thousandeyes.com.\\nlb-app.thousandeyes.com.\\t3600\\tIN\\tA\\t208.185.7.120\\n;; Received 173 bytes from 209.112.113.33(a1.verisigndns.com.) in 178 ms\\n\\n", + "mappings" : "208.185.7.120", + "startTime" : 1384309800, + "endTime" : 1384309800, + "roundId" : 1384309800, + "errorDetails" : "Connection error" + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.DnsTraceTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-test-results/test/test_dnssec_test_results_api.py b/thousandeyes-sdk-test-results/test/test_dnssec_test_results_api.py new file mode 100644 index 000000000..0a8bbdffc --- /dev/null +++ b/thousandeyes-sdk-test-results/test/test_dnssec_test_results_api.py @@ -0,0 +1,161 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.test_results.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.test_results.api.dnssec_test_results_api import DNSSECTestResultsApi + + +class TestDNSSECTestResultsApi(unittest.TestCase): + """DNSSECTestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSSECTestResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_dns_sec_results_models_validation(self) -> None: + """Test case for get_test_dns_sec_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "isValid" : true, + "startTime" : 1384309800, + "endTime" : 1384309800, + "roundId" : 1384309800, + "errorDetails" : "Connection error" + }, { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "isValid" : true, + "startTime" : 1384309800, + "endTime" : 1384309800, + "roundId" : 1384309800, + "errorDetails" : "Connection error" + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.DnssecTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-test-results/test/test_network_bgp_test_results_api.py b/thousandeyes-sdk-test-results/test/test_network_bgp_test_results_api.py new file mode 100644 index 000000000..2a2847fc5 --- /dev/null +++ b/thousandeyes-sdk-test-results/test/test_network_bgp_test_results_api.py @@ -0,0 +1,281 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.test_results.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.test_results.api.network_bgp_test_results_api import NetworkBGPTestResultsApi + + +class TestNetworkBGPTestResultsApi(unittest.TestCase): + """NetworkBGPTestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = NetworkBGPTestResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_bgp_results_models_validation(self) -> None: + """Test case for get_test_bgp_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "prefix" : "99.128.0.0/11", + "monitor" : { + "monitorId" : "281474976710706", + "monitorName" : "Vancouver, Canada - Bell Canada (AS 6539)", + "countryId" : "US" + }, + "startTime" : 1384309800, + "endTime" : 1384309800, + "reachability" : 0.0, + "updates" : 0.0, + "pathChanges" : 0.0, + "roundId" : 1384309800, + "prefixId" : "215" + }, { + "date" : "2022-07-17T22:00:54Z", + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "prefix" : "99.128.0.0/11", + "monitor" : { + "monitorId" : "281474976710706", + "monitorName" : "Vancouver, Canada - Bell Canada (AS 6539)", + "countryId" : "US" + }, + "startTime" : 1384309800, + "endTime" : 1384309800, + "reachability" : 0.0, + "updates" : 0.0, + "pathChanges" : 0.0, + "roundId" : 1384309800, + "prefixId" : "215" + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.BgpTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_test_bgp_routes_prefix_round_results_models_validation(self) -> None: + """Test case for get_test_bgp_routes_prefix_round_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "prefix" : "99.128.0.0/11", + "monitor" : { + "monitorId" : "281474976710706", + "monitorName" : "Vancouver, Canada - Bell Canada (AS 6539)", + "countryId" : "US" + }, + "hops" : [ { + "asName" : "Telus Advanced Communications", + "asn" : 852 + }, { + "asName" : "Telus Advanced Communications", + "asn" : 852 + } ], + "isActive" : true, + "roundId" : 1384309800, + "prefixId" : "215" + }, { + "date" : "2022-07-17T22:00:54Z", + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "prefix" : "99.128.0.0/11", + "monitor" : { + "monitorId" : "281474976710706", + "monitorName" : "Vancouver, Canada - Bell Canada (AS 6539)", + "countryId" : "US" + }, + "hops" : [ { + "asName" : "Telus Advanced Communications", + "asn" : 852 + }, { + "asName" : "Telus Advanced Communications", + "asn" : 852 + } ], + "isActive" : true, + "roundId" : 1384309800, + "prefixId" : "215" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.BgpTestRouteInformationResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-test-results/test/test_network_test_results_api.py b/thousandeyes-sdk-test-results/test/test_network_test_results_api.py new file mode 100644 index 000000000..a13109c56 --- /dev/null +++ b/thousandeyes-sdk-test-results/test/test_network_test_results_api.py @@ -0,0 +1,549 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.test_results.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.test_results.api.network_test_results_api import NetworkTestResultsApi + + +class TestNetworkTestResultsApi(unittest.TestCase): + """NetworkTestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = NetworkTestResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_network_results_models_validation(self) -> None: + """Test case for get_test_network_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "server" : "www.thousandeyes.com:80", + "availableBandwidth" : 9.100464, + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "packetsBySecond" : [ [ ], [ 0 ], [ 2 ], [ 2, 1 ], [ 1, 1 ] ], + "avgLatency" : 167.04, + "bandwidth" : 4.3313155, + "minLatency" : 167.0, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "maxLatency" : 168.0, + "healthScore" : 0.98, + "capacity" : 210.10854, + "loss" : 0.0, + "jitter" : 0.076808, + "serverIp" : "50.18.127.223", + "startTime" : 1384309800, + "endTime" : 1384309800, + "roundId" : 1384309800, + "direction" : "to-target" + }, { + "date" : "2022-07-17T22:00:54Z", + "server" : "www.thousandeyes.com:80", + "availableBandwidth" : 9.100464, + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "packetsBySecond" : [ [ ], [ 0 ], [ 2 ], [ 2, 1 ], [ 1, 1 ] ], + "avgLatency" : 167.04, + "bandwidth" : 4.3313155, + "minLatency" : 167.0, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "maxLatency" : 168.0, + "healthScore" : 0.98, + "capacity" : 210.10854, + "loss" : 0.0, + "jitter" : 0.076808, + "serverIp" : "50.18.127.223", + "startTime" : 1384309800, + "endTime" : 1384309800, + "roundId" : 1384309800, + "direction" : "to-target" + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.NetworkTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_test_path_vis_agent_round_results_models_validation(self) -> None: + """Test case for get_test_path_vis_agent_round_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "server" : "www.google.com:443", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "targetIsProxy" : true, + "sourcePrefix" : "196.40.96.0/20", + "sourceIp" : "196.40.106.237", + "pathTraces" : [ { + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "mpls" : "mpls", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "mpls" : "mpls", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803" + }, { + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "mpls" : "mpls", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "mpls" : "mpls", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803" + } ], + "serverIp" : "172.217.170.68", + "startTime" : 1384309800, + "endTime" : 1384309800, + "roundId" : 1384309800, + "direction" : "to-target" + }, { + "date" : "2022-07-17T22:00:54Z", + "server" : "www.google.com:443", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "targetIsProxy" : true, + "sourcePrefix" : "196.40.96.0/20", + "sourceIp" : "196.40.106.237", + "pathTraces" : [ { + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "mpls" : "mpls", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "mpls" : "mpls", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803" + }, { + "hops" : [ { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "mpls" : "mpls", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + }, { + "rdns" : "core-router1.cpt2.host-h.net", + "prefix" : "196.40.96.0/20", + "responseTime" : 1, + "hop" : 1, + "ipAddress" : "196.40.106.237", + "mpls" : "mpls", + "location" : "Cape Town, South Africa", + "network" : "HETZNER (Pty) Ltd (AS 37153)" + } ], + "pathId" : "4711301366345855606023718047703941305741293841502186803" + } ], + "serverIp" : "172.217.170.68", + "startTime" : 1384309800, + "endTime" : 1384309800, + "roundId" : 1384309800, + "direction" : "to-target" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.PathVisDetailTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_test_path_vis_results_models_validation(self) -> None: + """Test case for get_test_path_vis_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "server" : "www.google.com:443", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "targetIsProxy" : true, + "sourcePrefix" : "196.40.96.0/20", + "sourceIp" : "196.40.106.237", + "pathTraces" : [ { + "numberOfHops" : 15, + "responseTime" : 1500, + "ipAddress" : "196.40.106.237", + "pathMtu" : 1500, + "pathId" : "1230899668701775614109128428722974545787322404682781961521", + "mss" : 1460 + }, { + "numberOfHops" : 15, + "responseTime" : 1500, + "ipAddress" : "196.40.106.237", + "pathMtu" : 1500, + "pathId" : "1230899668701775614109128428722974545787322404682781961521", + "mss" : 1460 + } ], + "serverIp" : "172.217.170.68", + "startTime" : 1384309800, + "endTime" : 1384309800, + "roundId" : 1384309800, + "direction" : "to-target" + }, { + "date" : "2022-07-17T22:00:54Z", + "server" : "www.google.com:443", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "targetIsProxy" : true, + "sourcePrefix" : "196.40.96.0/20", + "sourceIp" : "196.40.106.237", + "pathTraces" : [ { + "numberOfHops" : 15, + "responseTime" : 1500, + "ipAddress" : "196.40.106.237", + "pathMtu" : 1500, + "pathId" : "1230899668701775614109128428722974545787322404682781961521", + "mss" : 1460 + }, { + "numberOfHops" : 15, + "responseTime" : 1500, + "ipAddress" : "196.40.106.237", + "pathMtu" : 1500, + "pathId" : "1230899668701775614109128428722974545787322404682781961521", + "mss" : 1460 + } ], + "serverIp" : "172.217.170.68", + "startTime" : 1384309800, + "endTime" : 1384309800, + "roundId" : 1384309800, + "direction" : "to-target" + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.PathVisTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-test-results/test/test_voice_rtp_server_test_results_api.py b/thousandeyes-sdk-test-results/test/test_voice_rtp_server_test_results_api.py new file mode 100644 index 000000000..ac7e94fdf --- /dev/null +++ b/thousandeyes-sdk-test-results/test/test_voice_rtp_server_test_results_api.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.test_results.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.test_results.api.voice_rtp_server_test_results_api import VoiceRTPServerTestResultsApi + + +class TestVoiceRTPServerTestResultsApi(unittest.TestCase): + """VoiceRTPServerTestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = VoiceRTPServerTestResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_rtp_server_results_models_validation(self) -> None: + """Test case for get_test_rtp_server_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "pdv" : 1, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dscpName" : "EF (DSCP 46)", + "latency" : 103, + "mos" : 4.351024, + "loss" : 0.0, + "dscp" : "46", + "codecMaxMos" : 4.41, + "discards" : 0.0, + "serverIp" : "172.97.102.37", + "errorDetail" : "Connection error", + "startTime" : 1384309800, + "endTime" : 1384309800, + "codecName" : "G.711 @ 64 Kbps", + "roundId" : 1384309800 + }, { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "pdv" : 1, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dscpName" : "EF (DSCP 46)", + "latency" : 103, + "mos" : 4.351024, + "loss" : 0.0, + "dscp" : "46", + "codecMaxMos" : 4.41, + "discards" : 0.0, + "serverIp" : "172.97.102.37", + "errorDetail" : "Connection error", + "startTime" : 1384309800, + "endTime" : 1384309800, + "codecName" : "G.711 @ 64 Kbps", + "roundId" : 1384309800 + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.RtpStreamTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-test-results/test/test_voice_sip_server_test_results_api.py b/thousandeyes-sdk-test-results/test/test_voice_sip_server_test_results_api.py new file mode 100644 index 000000000..b756d940e --- /dev/null +++ b/thousandeyes-sdk-test-results/test/test_voice_sip_server_test_results_api.py @@ -0,0 +1,189 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.test_results.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.test_results.api.voice_sip_server_test_results_api import VoiceSIPServerTestResultsApi + + +class TestVoiceSIPServerTestResultsApi(unittest.TestCase): + """VoiceSIPServerTestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = VoiceSIPServerTestResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_sip_server_results_models_validation(self) -> None: + """Test case for get_test_sip_server_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "numRedirects" : 0, + "registerTime" : 21, + "optionsTime" : 17, + "optionsRequest" : "OPTIONS sip:6054@voice.sfo2.notarealco.com SIP/2.0\\r\\nVia: SIP/2.0/TCP 38.140.61.68:55431;branch=z9hG4bKRTzPzMoVh0;rport\\r\\nFrom: ;tag=cGaJDNKQFE\\r\\nTo: \\r\\nCall-ID: oO9WaL3av8@38.140.61.68\\r\\nCSeq: 3 OPTIONS\\r\\nContact: \\r\\nUser-Agent: ThousandEyes Test Call\\r\\nAllow: INVITE, ACK, CANCEL, BYE\\r\\nSupported: outbound, path\\r\\nMax-Forwards: 70\\r\\nExpires: 60\\r\\nContent-Length: 0\\r\\n\\r\\n\\nOPTIONS sip:6054@voice.sfo2.notarealco.com SIP/2.0\\r\\nVia: SIP/2.0/TCP 38.140.61.68:55431;branch=z9hG4bKRTzPzMoVh0;rport\\r\\nFrom: ;tag=cGaJDNKQFE\\r\\nTo: \\r\\nCall-ID: oO9WaL3av8@38.140.61.68\\r\\nCSeq: 4 OPTIONS\\r\\nContact: \\r\\nAuthorization: Digest username=\\"al6054\\", realm=\\"asterisk\\", nonce=\\"1598728080/4e3bef2c789bdfa45ce9123221e08c8f\\", uri=\\"sip:6054@voice.sfo2.notarealco.com\\", response=\\"83c538a39ff766cf75ffd1d62317b442\\", algorithm=MD5, cnonce=\\"0a4f113b\\", opaque=\\"748ffa241d840721\\", qop=auth, nc=00000001\\r\\nUser-Agent: ThousandEyes Test Call\\r\\nAllow: INVITE, ACK, CANCEL, BYE\\r\\nSupported: outbound, path\\r\\nMax-Forwards: 70\\r\\nExpires: 60\\r\\nContent-Length: 0\\r\\n\\r\\n", + "responseTime" : 12, + "totalTime" : 40, + "errorType" : "none", + "availability" : 100.0, + "responseCode" : 200, + "optionsResponse" : "SIP/2.0 401 Unauthorized\\r\\nVia: SIP/2.0/TCP 38.140.61.68:55431;rport=55431;received=38.140.61.68;branch=z9hG4bKRTzPzMoVh0\\r\\nCall-ID: oO9WaL3av8@38.140.61.68\\r\\nFrom: ;tag=cGaJDNKQFE\\r\\nTo: ;tag=z9hG4bKRTzPzMoVh0\\r\\nCSeq: 3 OPTIONS\\r\\nWWW-Authenticate: Digest realm=\\"asterisk\\",nonce=\\"1598728080/4e3bef2c789bdfa45ce9123221e08c8f\\",opaque=\\"748ffa241d840721\\",algorithm=md5,qop=\\"auth\\"\\r\\nServer: Asterisk PBX 16.4.0\\r\\nContent-Length: 0\\r\\n\\r\\n\\nSIP/2.0 200 OK\\r\\nVia: SIP/2.0/TCP 38.140.61.68:55431;rport=55431;received=38.140.61.68;branch=z9hG4bKRTzPzMoVh0\\r\\nCall-ID: oO9WaL3av8@38.140.61.68\\r\\nFrom: ;tag=cGaJDNKQFE\\r\\nTo: ;tag=z9hG4bKRTzPzMoVh0\\r\\nCSeq: 4 OPTIONS\\r\\nAccept: application/xpidf+xml, application/cpim-pidf+xml, application/simple-message-summary, application/pidf+xml, application/dialog-info+xml, application/simple-message-summary, application/pidf+xml, application/dialog-info+xml, application/sdp, message/sipfrag;version=2.0\\r\\nAllow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER\\r\\nSupported: 100rel, timer, replaces, norefersub\\r\\nAccept-Encoding: text/plain\\r\\nAccept-Language: en\\r\\nServer: Asterisk PBX 16.4.0\\r\\nContent-Length: 0\\r\\n\\r\\n", + "problemDetail" : "problemDetail", + "connectTime" : 5, + "dnsTime" : 2, + "serverIp" : "193.2.1.88", + "startTime" : 1384309800, + "endTime" : 1384309800, + "roundId" : 1384309800, + "waitTime" : 5, + "inviteTime" : 10 + }, { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "numRedirects" : 0, + "registerTime" : 21, + "optionsTime" : 17, + "optionsRequest" : "OPTIONS sip:6054@voice.sfo2.notarealco.com SIP/2.0\\r\\nVia: SIP/2.0/TCP 38.140.61.68:55431;branch=z9hG4bKRTzPzMoVh0;rport\\r\\nFrom: ;tag=cGaJDNKQFE\\r\\nTo: \\r\\nCall-ID: oO9WaL3av8@38.140.61.68\\r\\nCSeq: 3 OPTIONS\\r\\nContact: \\r\\nUser-Agent: ThousandEyes Test Call\\r\\nAllow: INVITE, ACK, CANCEL, BYE\\r\\nSupported: outbound, path\\r\\nMax-Forwards: 70\\r\\nExpires: 60\\r\\nContent-Length: 0\\r\\n\\r\\n\\nOPTIONS sip:6054@voice.sfo2.notarealco.com SIP/2.0\\r\\nVia: SIP/2.0/TCP 38.140.61.68:55431;branch=z9hG4bKRTzPzMoVh0;rport\\r\\nFrom: ;tag=cGaJDNKQFE\\r\\nTo: \\r\\nCall-ID: oO9WaL3av8@38.140.61.68\\r\\nCSeq: 4 OPTIONS\\r\\nContact: \\r\\nAuthorization: Digest username=\\"al6054\\", realm=\\"asterisk\\", nonce=\\"1598728080/4e3bef2c789bdfa45ce9123221e08c8f\\", uri=\\"sip:6054@voice.sfo2.notarealco.com\\", response=\\"83c538a39ff766cf75ffd1d62317b442\\", algorithm=MD5, cnonce=\\"0a4f113b\\", opaque=\\"748ffa241d840721\\", qop=auth, nc=00000001\\r\\nUser-Agent: ThousandEyes Test Call\\r\\nAllow: INVITE, ACK, CANCEL, BYE\\r\\nSupported: outbound, path\\r\\nMax-Forwards: 70\\r\\nExpires: 60\\r\\nContent-Length: 0\\r\\n\\r\\n", + "responseTime" : 12, + "totalTime" : 40, + "errorType" : "none", + "availability" : 100.0, + "responseCode" : 200, + "optionsResponse" : "SIP/2.0 401 Unauthorized\\r\\nVia: SIP/2.0/TCP 38.140.61.68:55431;rport=55431;received=38.140.61.68;branch=z9hG4bKRTzPzMoVh0\\r\\nCall-ID: oO9WaL3av8@38.140.61.68\\r\\nFrom: ;tag=cGaJDNKQFE\\r\\nTo: ;tag=z9hG4bKRTzPzMoVh0\\r\\nCSeq: 3 OPTIONS\\r\\nWWW-Authenticate: Digest realm=\\"asterisk\\",nonce=\\"1598728080/4e3bef2c789bdfa45ce9123221e08c8f\\",opaque=\\"748ffa241d840721\\",algorithm=md5,qop=\\"auth\\"\\r\\nServer: Asterisk PBX 16.4.0\\r\\nContent-Length: 0\\r\\n\\r\\n\\nSIP/2.0 200 OK\\r\\nVia: SIP/2.0/TCP 38.140.61.68:55431;rport=55431;received=38.140.61.68;branch=z9hG4bKRTzPzMoVh0\\r\\nCall-ID: oO9WaL3av8@38.140.61.68\\r\\nFrom: ;tag=cGaJDNKQFE\\r\\nTo: ;tag=z9hG4bKRTzPzMoVh0\\r\\nCSeq: 4 OPTIONS\\r\\nAccept: application/xpidf+xml, application/cpim-pidf+xml, application/simple-message-summary, application/pidf+xml, application/dialog-info+xml, application/simple-message-summary, application/pidf+xml, application/dialog-info+xml, application/sdp, message/sipfrag;version=2.0\\r\\nAllow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER\\r\\nSupported: 100rel, timer, replaces, norefersub\\r\\nAccept-Encoding: text/plain\\r\\nAccept-Language: en\\r\\nServer: Asterisk PBX 16.4.0\\r\\nContent-Length: 0\\r\\n\\r\\n", + "problemDetail" : "problemDetail", + "connectTime" : 5, + "dnsTime" : 2, + "serverIp" : "193.2.1.88", + "startTime" : 1384309800, + "endTime" : 1384309800, + "roundId" : 1384309800, + "waitTime" : 5, + "inviteTime" : 10 + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.SipServerTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-test-results/test/test_web_ftp_server_test_results_api.py b/thousandeyes-sdk-test-results/test/test_web_ftp_server_test_results_api.py new file mode 100644 index 000000000..1e356e80e --- /dev/null +++ b/thousandeyes-sdk-test-results/test/test_web_ftp_server_test_results_api.py @@ -0,0 +1,183 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.test_results.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.test_results.api.web_ftp_server_test_results_api import WebFTPServerTestResultsApi + + +class TestWebFTPServerTestResultsApi(unittest.TestCase): + """WebFTPServerTestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = WebFTPServerTestResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_ftp_server_results_models_validation(self) -> None: + """Test case for get_test_ftp_server_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "transferTime" : 99.865, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "negotiationTime" : 503.413, + "responseTime" : 0.589, + "totalTime" : 705.554, + "errorType" : "None", + "responseCode" : 226, + "dnsTime" : 0.589, + "connectTime" : 50.153, + "serverIp" : "193.2.1.88", + "startTime" : 1384309800, + "endTime" : 1384309800, + "throughput" : 123, + "roundId" : 1384309800, + "waitTime" : 52.1, + "wireSize" : 22172, + "errorDetails" : "Connection error" + }, { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "transferTime" : 99.865, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "negotiationTime" : 503.413, + "responseTime" : 0.589, + "totalTime" : 705.554, + "errorType" : "None", + "responseCode" : 226, + "dnsTime" : 0.589, + "connectTime" : 50.153, + "serverIp" : "193.2.1.88", + "startTime" : 1384309800, + "endTime" : 1384309800, + "throughput" : 123, + "roundId" : 1384309800, + "waitTime" : 52.1, + "wireSize" : 22172, + "errorDetails" : "Connection error" + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.FtpServerTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-test-results/test/test_web_http_server_test_results_api.py b/thousandeyes-sdk-test-results/test/test_web_http_server_test_results_api.py new file mode 100644 index 000000000..3e5d513c0 --- /dev/null +++ b/thousandeyes-sdk-test-results/test/test_web_http_server_test_results_api.py @@ -0,0 +1,239 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.test_results.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.test_results.api.web_http_server_test_results_api import WebHTTPServerTestResultsApi + + +class TestWebHTTPServerTestResultsApi(unittest.TestCase): + """WebHTTPServerTestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = WebHTTPServerTestResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_http_server_results_models_validation(self) -> None: + """Test case for get_test_http_server_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "sslVersion" : "TLSv1.3", + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "numRedirects" : 0, + "errorType" : "None", + "healthScore" : 0.98, + "responseCode" : 200, + "connectTime" : 2, + "startTime" : 1384309800, + "throughput" : 123.0, + "roundId" : 1384309800, + "headers" : { + "requestHeaders" : "GET / HTTP/1.1\\r\\nHost: www.thousandeyes.com\\r\\nUser-Agent: curl/7.58.0-DEV\\r\\nAccept: */*\\r\\nAccept-Encoding: deflate, gzip\\r\\nX-ThousandEyes-Agent: yes\\r\\n", + "responseHeaders" : "HTTP/1.1 200 OK\\r\\nContent-Type: text/html;charset=UTF-8\\r\\nContent-Length: 9993\\r\\nConnection: keep-alive\\r\\nDate: Mon, 04 May 2020 16:13:00 GMT\\r\\nServer: Apache\\r\\nContent-Language: en-US\\r\\nContent-Encoding: gzip\\r\\nX-Frame-Options: sameorigin\\r\\nCache-Control: max-age=600, must-revalidate\\r\\nStrict-Transport-Security: max-age=31536000\\r\\nX-Content-Type-Options: nosniff\\r\\nX-XSS-Protection: 1; mode=block\\r\\nVary: Accept-Encoding\\r\\nX-Cache: Hit from cloudfront\\r\\nVia: 1.1 7ba3caf71ae7a52dd411d1a543e80cd8.cloudfront.net (CloudFront)\\r\\nX-Amz-Cf-Pop: SFO5-C3\\r\\nX-Amz-Cf-Id: w4h42tkoJD-rEpkRDZUvnQBmy26GVGe6pUsuRr1Dphf7oajYbjXaOA==\\r\\nAge: 132\\r\\n" + }, + "sslCipher" : "sslCipher", + "redirectTime" : 10, + "sslCertificates" : [ { + "hasValidSigningCert" : false, + "issuerName" : "DigiCert SHA2 Extended Validation Server CA", + "subjectAlternativeNames" : [ "www.thousandeyes.com", "thousandeyes.com" ], + "isFetchDateInValidCertDateRange" : true, + "validBefore" : "2020-05-12T12:00:00Z", + "daysUntilExpiry" : 0, + "validAfter" : "2018-03-27T00:00:00Z", + "subjectName" : "www.thousandeyes.com" + }, { + "hasValidSigningCert" : false, + "issuerName" : "DigiCert SHA2 Extended Validation Server CA", + "subjectAlternativeNames" : [ "www.thousandeyes.com", "thousandeyes.com" ], + "isFetchDateInValidCertDateRange" : true, + "validBefore" : "2020-05-12T12:00:00Z", + "daysUntilExpiry" : 0, + "validAfter" : "2018-03-27T00:00:00Z", + "subjectName" : "www.thousandeyes.com" + } ], + "responseTime" : 14, + "totalTime" : 15, + "receiveTime" : 1, + "dnsTime" : 0, + "serverIp" : "193.2.1.88", + "sslTime" : 9, + "endTime" : 1384309800, + "waitTime" : 3, + "wireSize" : 9993, + "errorDetails" : "Connection error" + }, { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "sslVersion" : "TLSv1.3", + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "numRedirects" : 0, + "errorType" : "None", + "healthScore" : 0.98, + "responseCode" : 200, + "connectTime" : 2, + "startTime" : 1384309800, + "throughput" : 123.0, + "roundId" : 1384309800, + "headers" : { + "requestHeaders" : "GET / HTTP/1.1\\r\\nHost: www.thousandeyes.com\\r\\nUser-Agent: curl/7.58.0-DEV\\r\\nAccept: */*\\r\\nAccept-Encoding: deflate, gzip\\r\\nX-ThousandEyes-Agent: yes\\r\\n", + "responseHeaders" : "HTTP/1.1 200 OK\\r\\nContent-Type: text/html;charset=UTF-8\\r\\nContent-Length: 9993\\r\\nConnection: keep-alive\\r\\nDate: Mon, 04 May 2020 16:13:00 GMT\\r\\nServer: Apache\\r\\nContent-Language: en-US\\r\\nContent-Encoding: gzip\\r\\nX-Frame-Options: sameorigin\\r\\nCache-Control: max-age=600, must-revalidate\\r\\nStrict-Transport-Security: max-age=31536000\\r\\nX-Content-Type-Options: nosniff\\r\\nX-XSS-Protection: 1; mode=block\\r\\nVary: Accept-Encoding\\r\\nX-Cache: Hit from cloudfront\\r\\nVia: 1.1 7ba3caf71ae7a52dd411d1a543e80cd8.cloudfront.net (CloudFront)\\r\\nX-Amz-Cf-Pop: SFO5-C3\\r\\nX-Amz-Cf-Id: w4h42tkoJD-rEpkRDZUvnQBmy26GVGe6pUsuRr1Dphf7oajYbjXaOA==\\r\\nAge: 132\\r\\n" + }, + "sslCipher" : "sslCipher", + "redirectTime" : 10, + "sslCertificates" : [ { + "hasValidSigningCert" : false, + "issuerName" : "DigiCert SHA2 Extended Validation Server CA", + "subjectAlternativeNames" : [ "www.thousandeyes.com", "thousandeyes.com" ], + "isFetchDateInValidCertDateRange" : true, + "validBefore" : "2020-05-12T12:00:00Z", + "daysUntilExpiry" : 0, + "validAfter" : "2018-03-27T00:00:00Z", + "subjectName" : "www.thousandeyes.com" + }, { + "hasValidSigningCert" : false, + "issuerName" : "DigiCert SHA2 Extended Validation Server CA", + "subjectAlternativeNames" : [ "www.thousandeyes.com", "thousandeyes.com" ], + "isFetchDateInValidCertDateRange" : true, + "validBefore" : "2020-05-12T12:00:00Z", + "daysUntilExpiry" : 0, + "validAfter" : "2018-03-27T00:00:00Z", + "subjectName" : "www.thousandeyes.com" + } ], + "responseTime" : 14, + "totalTime" : 15, + "receiveTime" : 1, + "dnsTime" : 0, + "serverIp" : "193.2.1.88", + "sslTime" : 9, + "endTime" : 1384309800, + "waitTime" : 3, + "wireSize" : 9993, + "errorDetails" : "Connection error" + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.HttpTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-test-results/test/test_web_page_load_test_results_api.py b/thousandeyes-sdk-test-results/test/test_web_page_load_test_results_api.py new file mode 100644 index 000000000..c3ff60274 --- /dev/null +++ b/thousandeyes-sdk-test-results/test/test_web_page_load_test_results_api.py @@ -0,0 +1,735 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.test_results.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.test_results.api.web_page_load_test_results_api import WebPageLoadTestResultsApi + + +class TestWebPageLoadTestResultsApi(unittest.TestCase): + """WebPageLoadTestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = WebPageLoadTestResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_page_load_agent_round_results_models_validation(self) -> None: + """Test case for get_test_page_load_agent_round_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "numErrors" : 0, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "responseTime" : 34.35, + "pageLoadTime" : 352, + "numObjects" : 17, + "totalSize" : 403301, + "domLoadTime" : 352, + "har" : { + "log" : { + "creator" : { + "name" : "ThousandEyes DB Exporter" + }, + "entries" : [ { + "pageref" : "page_0", + "request" : { + "headers" : [ { + "name" : ":authority", + "value" : "google.com" + }, { + "name" : ":method", + "value" : "GET" + }, { + "name" : ":path", + "value" : "/" + }, { + "name" : ":scheme", + "value" : "https" + }, { + "name" : "accept", + "value" : "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" + }, { + "name" : "accept-encoding", + "value" : "gzip, deflate, br" + }, { + "name" : "accept-language", + "value" : "en-US,en;q=0.9" + }, { + "name" : "upgrade-insecure-requests", + "value" : "1" + }, { + "name" : "user-agent", + "value" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.83 Safari/537.36" + }, { + "name" : "x-thousandeyes-agent", + "value" : "yes" + } ], + "method" : "GET", + "url" : "https://google.com/" + }, + "response" : { + "bodySize" : 220, + "content" : { + "mimeType" : "text/html", + "size" : 220 + }, + "headers" : [ { + "name" : "alt-svc", + "value" : "quic=\\":443\\"; ma=2592000; v=\\"46,43\\",h3-Q050=\\":443\\"; ma=2592000,h3-Q049=\\":443\\"; ma=2592000,h3-Q048=\\":443\\"; ma=2592000,h3-Q046=\\":443\\"; ma=2592000,h3-Q043=\\":443\\"; ma=2592000" + }, { + "name" : "cache-control", + "value" : "public, max-age=2592000" + }, { + "name" : "content-length", + "value" : "220" + }, { + "name" : "content-type", + "value" : "text/html; charset=UTF-8" + }, { + "name" : "date", + "value" : "Fri, 15 Nov 2019 16:41:54 GMT" + }, { + "name" : "expires", + "value" : "Sun, 15 Dec 2019 16:41:54 GMT" + }, { + "name" : "location", + "value" : "https://www.google.com/" + }, { + "name" : "server", + "value" : "gws" + }, { + "name" : "status", + "value" : "301" + }, { + "name" : "x-frame-options", + "value" : "SAMEORIGIN" + }, { + "name" : "x-xss-protection", + "value" : "0" + } ], + "headersSize" : 471, + "redirectURL" : "", + "status" : 301, + "statusText" : "MOVED_PERMANENTLY" + }, + "serverIPAddress" : "172.217.6.110", + "startedDateTime" : "2019-11-15T16:41:54.798Z", + "time" : 71, + "timings" : { + "blocked" : 2, + "connect" : 16, + "dns" : 1, + "receive" : 1, + "send" : 0, + "ssl" : 14, + "wait" : 50 + } + }, { + "pageref" : "page_0", + "request" : { + "headers" : [ { + "name" : ":authority", + "value" : "www.google.com" + }, { + "name" : ":method", + "value" : "GET" + }, { + "name" : ":path", + "value" : "/" + }, { + "name" : ":scheme", + "value" : "https" + }, { + "name" : "accept", + "value" : "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" + }, { + "name" : "accept-encoding", + "value" : "gzip, deflate, br" + }, { + "name" : "accept-language", + "value" : "en-US,en;q=0.9" + }, { + "name" : "upgrade-insecure-requests", + "value" : "1" + }, { + "name" : "user-agent", + "value" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.83 Safari/537.36" + }, { + "name" : "x-thousandeyes-agent", + "value" : "yes" + } ], + "method" : "GET", + "url" : "https://www.google.com/" + }, + "response" : { + "bodySize" : 65214, + "content" : { + "mimeType" : "text/html", + "size" : 225039 + }, + "headers" : [ { + "name" : "alt-svc", + "value" : "quic=\\":443\\"; ma=2592000; v=\\"46,43\\",h3-Q050=\\":443\\"; ma=2592000,h3-Q049=\\":443\\"; ma=2592000,h3-Q048=\\":443\\"; ma=2592000,h3-Q046=\\":443\\"; ma=2592000,h3-Q043=\\":443\\"; ma=2592000" + }, { + "name" : "cache-control", + "value" : "private, max-age=0" + }, { + "name" : "content-encoding", + "value" : "br" + }, { + "name" : "content-length", + "value" : "65214" + }, { + "name" : "content-type", + "value" : "text/html; charset=UTF-8" + }, { + "name" : "date", + "value" : "Fri, 15 Nov 2019 16:41:54 GMT" + }, { + "name" : "expires", + "value" : "-1" + }, { + "name" : "p3p", + "value" : "CP=\\"This is not a P3P policy! See g.co/p3phelp for more info.\\"" + }, { + "name" : "server", + "value" : "gws" + }, { + "name" : "set-cookie", + "value" : "(removed)" + }, { + "name" : "status", + "value" : "200" + }, { + "name" : "strict-transport-security", + "value" : "max-age=31536000" + }, { + "name" : "x-frame-options", + "value" : "SAMEORIGIN" + }, { + "name" : "x-xss-protection", + "value" : "0" + } ], + "headersSize" : 915, + "redirectURL" : "", + "status" : 200, + "statusText" : "OK" + }, + "serverIPAddress" : "172.217.4.196", + "startedDateTime" : "2019-11-15T16:41:54.870Z", + "time" : 182, + "timings" : { + "blocked" : 2, + "connect" : 4, + "dns" : 0, + "receive" : 58, + "send" : 0, + "ssl" : 2, + "wait" : 118 + } + } ], + "pages" : [ { + "id" : "page_0", + "pageTimings" : { + "onContentLoad" : 367, + "onLoad" : 737 + }, + "responseCode" : 0, + "startedDateTime" : "2019-11-15T16:41:54.796Z", + "title" : "Google" + } ], + "version" : "1.2" + } + }, + "startTime" : 1384309800, + "endTime" : 1384309800, + "roundId" : 1384309800 + }, { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "numErrors" : 0, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "responseTime" : 34.35, + "pageLoadTime" : 352, + "numObjects" : 17, + "totalSize" : 403301, + "domLoadTime" : 352, + "har" : { + "log" : { + "creator" : { + "name" : "ThousandEyes DB Exporter" + }, + "entries" : [ { + "pageref" : "page_0", + "request" : { + "headers" : [ { + "name" : ":authority", + "value" : "google.com" + }, { + "name" : ":method", + "value" : "GET" + }, { + "name" : ":path", + "value" : "/" + }, { + "name" : ":scheme", + "value" : "https" + }, { + "name" : "accept", + "value" : "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" + }, { + "name" : "accept-encoding", + "value" : "gzip, deflate, br" + }, { + "name" : "accept-language", + "value" : "en-US,en;q=0.9" + }, { + "name" : "upgrade-insecure-requests", + "value" : "1" + }, { + "name" : "user-agent", + "value" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.83 Safari/537.36" + }, { + "name" : "x-thousandeyes-agent", + "value" : "yes" + } ], + "method" : "GET", + "url" : "https://google.com/" + }, + "response" : { + "bodySize" : 220, + "content" : { + "mimeType" : "text/html", + "size" : 220 + }, + "headers" : [ { + "name" : "alt-svc", + "value" : "quic=\\":443\\"; ma=2592000; v=\\"46,43\\",h3-Q050=\\":443\\"; ma=2592000,h3-Q049=\\":443\\"; ma=2592000,h3-Q048=\\":443\\"; ma=2592000,h3-Q046=\\":443\\"; ma=2592000,h3-Q043=\\":443\\"; ma=2592000" + }, { + "name" : "cache-control", + "value" : "public, max-age=2592000" + }, { + "name" : "content-length", + "value" : "220" + }, { + "name" : "content-type", + "value" : "text/html; charset=UTF-8" + }, { + "name" : "date", + "value" : "Fri, 15 Nov 2019 16:41:54 GMT" + }, { + "name" : "expires", + "value" : "Sun, 15 Dec 2019 16:41:54 GMT" + }, { + "name" : "location", + "value" : "https://www.google.com/" + }, { + "name" : "server", + "value" : "gws" + }, { + "name" : "status", + "value" : "301" + }, { + "name" : "x-frame-options", + "value" : "SAMEORIGIN" + }, { + "name" : "x-xss-protection", + "value" : "0" + } ], + "headersSize" : 471, + "redirectURL" : "", + "status" : 301, + "statusText" : "MOVED_PERMANENTLY" + }, + "serverIPAddress" : "172.217.6.110", + "startedDateTime" : "2019-11-15T16:41:54.798Z", + "time" : 71, + "timings" : { + "blocked" : 2, + "connect" : 16, + "dns" : 1, + "receive" : 1, + "send" : 0, + "ssl" : 14, + "wait" : 50 + } + }, { + "pageref" : "page_0", + "request" : { + "headers" : [ { + "name" : ":authority", + "value" : "www.google.com" + }, { + "name" : ":method", + "value" : "GET" + }, { + "name" : ":path", + "value" : "/" + }, { + "name" : ":scheme", + "value" : "https" + }, { + "name" : "accept", + "value" : "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" + }, { + "name" : "accept-encoding", + "value" : "gzip, deflate, br" + }, { + "name" : "accept-language", + "value" : "en-US,en;q=0.9" + }, { + "name" : "upgrade-insecure-requests", + "value" : "1" + }, { + "name" : "user-agent", + "value" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.83 Safari/537.36" + }, { + "name" : "x-thousandeyes-agent", + "value" : "yes" + } ], + "method" : "GET", + "url" : "https://www.google.com/" + }, + "response" : { + "bodySize" : 65214, + "content" : { + "mimeType" : "text/html", + "size" : 225039 + }, + "headers" : [ { + "name" : "alt-svc", + "value" : "quic=\\":443\\"; ma=2592000; v=\\"46,43\\",h3-Q050=\\":443\\"; ma=2592000,h3-Q049=\\":443\\"; ma=2592000,h3-Q048=\\":443\\"; ma=2592000,h3-Q046=\\":443\\"; ma=2592000,h3-Q043=\\":443\\"; ma=2592000" + }, { + "name" : "cache-control", + "value" : "private, max-age=0" + }, { + "name" : "content-encoding", + "value" : "br" + }, { + "name" : "content-length", + "value" : "65214" + }, { + "name" : "content-type", + "value" : "text/html; charset=UTF-8" + }, { + "name" : "date", + "value" : "Fri, 15 Nov 2019 16:41:54 GMT" + }, { + "name" : "expires", + "value" : "-1" + }, { + "name" : "p3p", + "value" : "CP=\\"This is not a P3P policy! See g.co/p3phelp for more info.\\"" + }, { + "name" : "server", + "value" : "gws" + }, { + "name" : "set-cookie", + "value" : "(removed)" + }, { + "name" : "status", + "value" : "200" + }, { + "name" : "strict-transport-security", + "value" : "max-age=31536000" + }, { + "name" : "x-frame-options", + "value" : "SAMEORIGIN" + }, { + "name" : "x-xss-protection", + "value" : "0" + } ], + "headersSize" : 915, + "redirectURL" : "", + "status" : 200, + "statusText" : "OK" + }, + "serverIPAddress" : "172.217.4.196", + "startedDateTime" : "2019-11-15T16:41:54.870Z", + "time" : 182, + "timings" : { + "blocked" : 2, + "connect" : 4, + "dns" : 0, + "receive" : 58, + "send" : 0, + "ssl" : 2, + "wait" : 118 + } + } ], + "pages" : [ { + "id" : "page_0", + "pageTimings" : { + "onContentLoad" : 367, + "onLoad" : 737 + }, + "responseCode" : 0, + "startedDateTime" : "2019-11-15T16:41:54.796Z", + "title" : "Google" + } ], + "version" : "1.2" + } + }, + "startTime" : 1384309800, + "endTime" : 1384309800, + "roundId" : 1384309800 + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.PageLoadDetailTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_test_page_load_results_models_validation(self) -> None: + """Test case for get_test_page_load_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "totalSize" : 403301, + "numErrors" : 0, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "responseTime" : 34.35, + "domLoadTime" : 352, + "startTime" : 1384309800, + "pageLoadTime" : 352, + "endTime" : 1384309800, + "roundId" : 1384309800, + "numObjects" : 17 + }, { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "totalSize" : 403301, + "numErrors" : 0, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "responseTime" : 34.35, + "domLoadTime" : 352, + "startTime" : 1384309800, + "pageLoadTime" : 352, + "endTime" : 1384309800, + "roundId" : 1384309800, + "numObjects" : 17 + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.PageLoadTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-test-results/test/test_web_transactions_test_results_api.py b/thousandeyes-sdk-test-results/test/test_web_transactions_test_results_api.py new file mode 100644 index 000000000..454133ccd --- /dev/null +++ b/thousandeyes-sdk-test-results/test/test_web_transactions_test_results_api.py @@ -0,0 +1,937 @@ +# coding: utf-8 + +""" + Test Results API + + Get test result metrics for Cloud and Enterprise Agent tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.test_results.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.test_results.api.web_transactions_test_results_api import WebTransactionsTestResultsApi + + +class TestWebTransactionsTestResultsApi(unittest.TestCase): + """WebTransactionsTestResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = WebTransactionsTestResultsApi() + + def tearDown(self) -> None: + pass + + def test_get_test_web_transaction_agent_round_page_results_models_validation(self) -> None: + """Test case for get_test_web_transaction_agent_round_page_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "componentErrors" : 5, + "errorType" : "None", + "transactionTime" : 2379, + "pages" : [ { + "duration" : 1117.5660001039505, + "componentCount" : 136, + "pageNum" : 0, + "pageName" : "Google", + "errorCount" : 0 + }, { + "duration" : 1117.5660001039505, + "componentCount" : 136, + "pageNum" : 0, + "pageName" : "Google", + "errorCount" : 0 + } ], + "har" : { + "log" : { + "creator" : { + "name" : "ThousandEyes DB Exporter" + }, + "entries" : [ { + "pageref" : "page_0", + "request" : { + "headers" : [ { + "name" : ":authority", + "value" : "google.com" + }, { + "name" : ":method", + "value" : "GET" + }, { + "name" : ":path", + "value" : "/" + }, { + "name" : ":scheme", + "value" : "https" + }, { + "name" : "accept", + "value" : "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" + }, { + "name" : "accept-encoding", + "value" : "gzip, deflate, br" + }, { + "name" : "accept-language", + "value" : "en-US,en;q=0.9" + }, { + "name" : "upgrade-insecure-requests", + "value" : "1" + }, { + "name" : "user-agent", + "value" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.83 Safari/537.36" + }, { + "name" : "x-thousandeyes-agent", + "value" : "yes" + } ], + "method" : "GET", + "url" : "https://google.com/" + }, + "response" : { + "bodySize" : 220, + "content" : { + "mimeType" : "text/html", + "size" : 220 + }, + "headers" : [ { + "name" : "alt-svc", + "value" : "quic=\\":443\\"; ma=2592000; v=\\"46,43\\",h3-Q050=\\":443\\"; ma=2592000,h3-Q049=\\":443\\"; ma=2592000,h3-Q048=\\":443\\"; ma=2592000,h3-Q046=\\":443\\"; ma=2592000,h3-Q043=\\":443\\"; ma=2592000" + }, { + "name" : "cache-control", + "value" : "public, max-age=2592000" + }, { + "name" : "content-length", + "value" : "220" + }, { + "name" : "content-type", + "value" : "text/html; charset=UTF-8" + }, { + "name" : "date", + "value" : "Fri, 15 Nov 2019 16:41:54 GMT" + }, { + "name" : "expires", + "value" : "Sun, 15 Dec 2019 16:41:54 GMT" + }, { + "name" : "location", + "value" : "https://www.google.com/" + }, { + "name" : "server", + "value" : "gws" + }, { + "name" : "status", + "value" : "301" + }, { + "name" : "x-frame-options", + "value" : "SAMEORIGIN" + }, { + "name" : "x-xss-protection", + "value" : "0" + } ], + "headersSize" : 471, + "redirectURL" : "", + "status" : 301, + "statusText" : "MOVED_PERMANENTLY" + }, + "serverIPAddress" : "172.217.6.110", + "startedDateTime" : "2019-11-15T16:41:54.798Z", + "time" : 71, + "timings" : { + "blocked" : 2, + "connect" : 16, + "dns" : 1, + "receive" : 1, + "send" : 0, + "ssl" : 14, + "wait" : 50 + } + }, { + "pageref" : "page_0", + "request" : { + "headers" : [ { + "name" : ":authority", + "value" : "www.google.com" + }, { + "name" : ":method", + "value" : "GET" + }, { + "name" : ":path", + "value" : "/" + }, { + "name" : ":scheme", + "value" : "https" + }, { + "name" : "accept", + "value" : "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" + }, { + "name" : "accept-encoding", + "value" : "gzip, deflate, br" + }, { + "name" : "accept-language", + "value" : "en-US,en;q=0.9" + }, { + "name" : "upgrade-insecure-requests", + "value" : "1" + }, { + "name" : "user-agent", + "value" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.83 Safari/537.36" + }, { + "name" : "x-thousandeyes-agent", + "value" : "yes" + } ], + "method" : "GET", + "url" : "https://www.google.com/" + }, + "response" : { + "bodySize" : 65214, + "content" : { + "mimeType" : "text/html", + "size" : 225039 + }, + "headers" : [ { + "name" : "alt-svc", + "value" : "quic=\\":443\\"; ma=2592000; v=\\"46,43\\",h3-Q050=\\":443\\"; ma=2592000,h3-Q049=\\":443\\"; ma=2592000,h3-Q048=\\":443\\"; ma=2592000,h3-Q046=\\":443\\"; ma=2592000,h3-Q043=\\":443\\"; ma=2592000" + }, { + "name" : "cache-control", + "value" : "private, max-age=0" + }, { + "name" : "content-encoding", + "value" : "br" + }, { + "name" : "content-length", + "value" : "65214" + }, { + "name" : "content-type", + "value" : "text/html; charset=UTF-8" + }, { + "name" : "date", + "value" : "Fri, 15 Nov 2019 16:41:54 GMT" + }, { + "name" : "expires", + "value" : "-1" + }, { + "name" : "p3p", + "value" : "CP=\\"This is not a P3P policy! See g.co/p3phelp for more info.\\"" + }, { + "name" : "server", + "value" : "gws" + }, { + "name" : "set-cookie", + "value" : "(removed)" + }, { + "name" : "status", + "value" : "200" + }, { + "name" : "strict-transport-security", + "value" : "max-age=31536000" + }, { + "name" : "x-frame-options", + "value" : "SAMEORIGIN" + }, { + "name" : "x-xss-protection", + "value" : "0" + } ], + "headersSize" : 915, + "redirectURL" : "", + "status" : 200, + "statusText" : "OK" + }, + "serverIPAddress" : "172.217.4.196", + "startedDateTime" : "2019-11-15T16:41:54.870Z", + "time" : 182, + "timings" : { + "blocked" : 2, + "connect" : 4, + "dns" : 0, + "receive" : 58, + "send" : 0, + "ssl" : 2, + "wait" : 118 + } + } ], + "pages" : [ { + "id" : "page_0", + "pageTimings" : { + "onContentLoad" : 367, + "onLoad" : 737 + }, + "responseCode" : 0, + "startedDateTime" : "2019-11-15T16:41:54.796Z", + "title" : "Google" + } ], + "version" : "1.2" + } + }, + "startTime" : 1384309800, + "endTime" : 1384309800, + "markers" : [ { + "duration" : 0, + "name" : "SearchForWebdriver" + }, { + "duration" : 0, + "name" : "SearchForWebdriver" + } ], + "roundId" : 1384309800, + "errorDetails" : "Connection error" + }, { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "componentErrors" : 5, + "errorType" : "None", + "transactionTime" : 2379, + "pages" : [ { + "duration" : 1117.5660001039505, + "componentCount" : 136, + "pageNum" : 0, + "pageName" : "Google", + "errorCount" : 0 + }, { + "duration" : 1117.5660001039505, + "componentCount" : 136, + "pageNum" : 0, + "pageName" : "Google", + "errorCount" : 0 + } ], + "har" : { + "log" : { + "creator" : { + "name" : "ThousandEyes DB Exporter" + }, + "entries" : [ { + "pageref" : "page_0", + "request" : { + "headers" : [ { + "name" : ":authority", + "value" : "google.com" + }, { + "name" : ":method", + "value" : "GET" + }, { + "name" : ":path", + "value" : "/" + }, { + "name" : ":scheme", + "value" : "https" + }, { + "name" : "accept", + "value" : "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" + }, { + "name" : "accept-encoding", + "value" : "gzip, deflate, br" + }, { + "name" : "accept-language", + "value" : "en-US,en;q=0.9" + }, { + "name" : "upgrade-insecure-requests", + "value" : "1" + }, { + "name" : "user-agent", + "value" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.83 Safari/537.36" + }, { + "name" : "x-thousandeyes-agent", + "value" : "yes" + } ], + "method" : "GET", + "url" : "https://google.com/" + }, + "response" : { + "bodySize" : 220, + "content" : { + "mimeType" : "text/html", + "size" : 220 + }, + "headers" : [ { + "name" : "alt-svc", + "value" : "quic=\\":443\\"; ma=2592000; v=\\"46,43\\",h3-Q050=\\":443\\"; ma=2592000,h3-Q049=\\":443\\"; ma=2592000,h3-Q048=\\":443\\"; ma=2592000,h3-Q046=\\":443\\"; ma=2592000,h3-Q043=\\":443\\"; ma=2592000" + }, { + "name" : "cache-control", + "value" : "public, max-age=2592000" + }, { + "name" : "content-length", + "value" : "220" + }, { + "name" : "content-type", + "value" : "text/html; charset=UTF-8" + }, { + "name" : "date", + "value" : "Fri, 15 Nov 2019 16:41:54 GMT" + }, { + "name" : "expires", + "value" : "Sun, 15 Dec 2019 16:41:54 GMT" + }, { + "name" : "location", + "value" : "https://www.google.com/" + }, { + "name" : "server", + "value" : "gws" + }, { + "name" : "status", + "value" : "301" + }, { + "name" : "x-frame-options", + "value" : "SAMEORIGIN" + }, { + "name" : "x-xss-protection", + "value" : "0" + } ], + "headersSize" : 471, + "redirectURL" : "", + "status" : 301, + "statusText" : "MOVED_PERMANENTLY" + }, + "serverIPAddress" : "172.217.6.110", + "startedDateTime" : "2019-11-15T16:41:54.798Z", + "time" : 71, + "timings" : { + "blocked" : 2, + "connect" : 16, + "dns" : 1, + "receive" : 1, + "send" : 0, + "ssl" : 14, + "wait" : 50 + } + }, { + "pageref" : "page_0", + "request" : { + "headers" : [ { + "name" : ":authority", + "value" : "www.google.com" + }, { + "name" : ":method", + "value" : "GET" + }, { + "name" : ":path", + "value" : "/" + }, { + "name" : ":scheme", + "value" : "https" + }, { + "name" : "accept", + "value" : "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" + }, { + "name" : "accept-encoding", + "value" : "gzip, deflate, br" + }, { + "name" : "accept-language", + "value" : "en-US,en;q=0.9" + }, { + "name" : "upgrade-insecure-requests", + "value" : "1" + }, { + "name" : "user-agent", + "value" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.83 Safari/537.36" + }, { + "name" : "x-thousandeyes-agent", + "value" : "yes" + } ], + "method" : "GET", + "url" : "https://www.google.com/" + }, + "response" : { + "bodySize" : 65214, + "content" : { + "mimeType" : "text/html", + "size" : 225039 + }, + "headers" : [ { + "name" : "alt-svc", + "value" : "quic=\\":443\\"; ma=2592000; v=\\"46,43\\",h3-Q050=\\":443\\"; ma=2592000,h3-Q049=\\":443\\"; ma=2592000,h3-Q048=\\":443\\"; ma=2592000,h3-Q046=\\":443\\"; ma=2592000,h3-Q043=\\":443\\"; ma=2592000" + }, { + "name" : "cache-control", + "value" : "private, max-age=0" + }, { + "name" : "content-encoding", + "value" : "br" + }, { + "name" : "content-length", + "value" : "65214" + }, { + "name" : "content-type", + "value" : "text/html; charset=UTF-8" + }, { + "name" : "date", + "value" : "Fri, 15 Nov 2019 16:41:54 GMT" + }, { + "name" : "expires", + "value" : "-1" + }, { + "name" : "p3p", + "value" : "CP=\\"This is not a P3P policy! See g.co/p3phelp for more info.\\"" + }, { + "name" : "server", + "value" : "gws" + }, { + "name" : "set-cookie", + "value" : "(removed)" + }, { + "name" : "status", + "value" : "200" + }, { + "name" : "strict-transport-security", + "value" : "max-age=31536000" + }, { + "name" : "x-frame-options", + "value" : "SAMEORIGIN" + }, { + "name" : "x-xss-protection", + "value" : "0" + } ], + "headersSize" : 915, + "redirectURL" : "", + "status" : 200, + "statusText" : "OK" + }, + "serverIPAddress" : "172.217.4.196", + "startedDateTime" : "2019-11-15T16:41:54.870Z", + "time" : 182, + "timings" : { + "blocked" : 2, + "connect" : 4, + "dns" : 0, + "receive" : 58, + "send" : 0, + "ssl" : 2, + "wait" : 118 + } + } ], + "pages" : [ { + "id" : "page_0", + "pageTimings" : { + "onContentLoad" : 367, + "onLoad" : 737 + }, + "responseCode" : 0, + "startedDateTime" : "2019-11-15T16:41:54.796Z", + "title" : "Google" + } ], + "version" : "1.2" + } + }, + "startTime" : 1384309800, + "endTime" : 1384309800, + "markers" : [ { + "duration" : 0, + "name" : "SearchForWebdriver" + }, { + "duration" : 0, + "name" : "SearchForWebdriver" + } ], + "roundId" : 1384309800, + "errorDetails" : "Connection error" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.WebTransactionPageDetailTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_test_web_transaction_agent_round_results_models_validation(self) -> None: + """Test case for get_test_web_transaction_agent_round_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "pages" : [ { + "duration" : 1117.5660001039505, + "componentCount" : 136, + "pageNum" : 0, + "pageName" : "Google", + "errorCount" : 0 + }, { + "duration" : 1117.5660001039505, + "componentCount" : 136, + "pageNum" : 0, + "pageName" : "Google", + "errorCount" : 0 + } ], + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "componentErrors" : 5, + "errorType" : "None", + "startTime" : 1384309800, + "endTime" : 1384309800, + "transactionTime" : 2379, + "markers" : [ { + "duration" : 0, + "name" : "SearchForWebdriver" + }, { + "duration" : 0, + "name" : "SearchForWebdriver" + } ], + "roundId" : 1384309800, + "errorDetails" : "Connection error" + }, { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "pages" : [ { + "duration" : 1117.5660001039505, + "componentCount" : 136, + "pageNum" : 0, + "pageName" : "Google", + "errorCount" : 0 + }, { + "duration" : 1117.5660001039505, + "componentCount" : 136, + "pageNum" : 0, + "pageName" : "Google", + "errorCount" : 0 + } ], + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "componentErrors" : 5, + "errorType" : "None", + "startTime" : 1384309800, + "endTime" : 1384309800, + "transactionTime" : 2379, + "markers" : [ { + "duration" : 0, + "name" : "SearchForWebdriver" + }, { + "duration" : 0, + "name" : "SearchForWebdriver" + } ], + "roundId" : 1384309800, + "errorDetails" : "Connection error" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.WebTransactionDetailTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_test_web_transaction_results_models_validation(self) -> None: + """Test case for get_test_web_transaction_results request and response models""" + + response_body_json = """ + { + "test" : { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "results" : [ { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "componentErrors" : 5, + "errorType" : "None", + "startTime" : 1384309800, + "endTime" : 1384309800, + "transactionTime" : 2379, + "roundId" : 1384309800, + "errorDetails" : "Connection error" + }, { + "date" : "2022-07-17T22:00:54Z", + "agent" : { + "agentId" : "281474976710706", + "agentName" : "thousandeyes-stg-va-254", + "location" : "San Francisco Bay Area", + "countryId" : "US" + }, + "_links" : { + "appLink" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "componentErrors" : 5, + "errorType" : "None", + "startTime" : 1384309800, + "endTime" : 1384309800, + "transactionTime" : 2379, + "roundId" : 1384309800, + "errorDetails" : "Connection error" + } ], + "startDate" : "2022-07-17T22:00:54Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.test_results.models.WebTransactionTestResults.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-tests/.openapi-generator/FILES b/thousandeyes-sdk-tests/.openapi-generator/FILES index 68a6acae5..f25c2acec 100644 --- a/thousandeyes-sdk-tests/.openapi-generator/FILES +++ b/thousandeyes-sdk-tests/.openapi-generator/FILES @@ -1,27 +1,29 @@ .openapi-generator-ignore MANIFEST.in README.md -docs/APIApi.md -docs/Agent.md +docs/APITestsApi.md docs/AgentBase.md docs/AgentInterfaces.md -docs/AgentRequest.md -docs/AgentToAgentApi.md +docs/AgentResponse.md docs/AgentToAgentInstantTest.md docs/AgentToAgentProperties.md docs/AgentToAgentTest.md docs/AgentToAgentTestProtocol.md +docs/AgentToAgentTestRequest.md +docs/AgentToAgentTestResponse.md docs/AgentToAgentTests.md -docs/AgentToServerApi.md +docs/AgentToAgentTestsApi.md docs/AgentToServerInstantTest.md docs/AgentToServerProperties.md docs/AgentToServerTest.md +docs/AgentToServerTestRequest.md +docs/AgentToServerTestResponse.md docs/AgentToServerTests.md +docs/AgentToServerTestsApi.md docs/AlertDirection.md docs/AlertRoundsViolationMode.md docs/AlertRule.md docs/AlertType.md -docs/AllTestTypesApi.md docs/ApiInstantTest.md docs/ApiPredefinedVariable.md docs/ApiProperties.md @@ -34,44 +36,59 @@ docs/ApiRequestHeader.md docs/ApiRequestMethod.md docs/ApiRequestVariable.md docs/ApiTest.md +docs/ApiTestRequest.md +docs/ApiTestResponse.md docs/ApiTests.md -docs/BGPApi.md +docs/BGPTestsApi.md docs/BaseBgpTest.md docs/BaseRequest.md docs/BaseTest.md docs/BgpTest.md +docs/BgpTestRequest.md +docs/BgpTestResponse.md docs/BgpTests.md docs/CloudEnterpriseAgentType.md -docs/DNSSECApi.md -docs/DNSServerApi.md -docs/DNSTraceApi.md +docs/DNSSECTestsApi.md +docs/DNSServerTestsApi.md +docs/DNSTraceTestsApi.md docs/DnsQueryClass.md docs/DnsSecInstantTest.md docs/DnsSecProperties.md docs/DnsSecTest.md +docs/DnsSecTestRequest.md +docs/DnsSecTestResponse.md docs/DnsSecTests.md docs/DnsServerInstantTest.md docs/DnsServerProperties.md docs/DnsServerTest.md +docs/DnsServerTestRequest.md +docs/DnsServerTestResponse.md docs/DnsServerTests.md docs/DnsServersRequest.md docs/DnsTraceInstantTest.md docs/DnsTraceProperties.md docs/DnsTraceTest.md +docs/DnsTraceTestRequest.md +docs/DnsTraceTestResponse.md docs/DnsTraceTests.md docs/Error.md -docs/Expand.md -docs/FTPServerApi.md +docs/ExpandBgpTestOptions.md +docs/ExpandTestOptions.md +docs/FTPServerTestsApi.md docs/FtpServerInstantTest.md docs/FtpServerProperties.md docs/FtpServerRequestType.md docs/FtpServerTest.md +docs/FtpServerTestRequest.md +docs/FtpServerTestResponse.md docs/FtpServerTests.md -docs/HTTPServerApi.md +docs/HTTPServerTestsApi.md docs/HttpServerBaseProperties.md docs/HttpServerInstantTest.md docs/HttpServerProperties.md docs/HttpServerTest.md +docs/HttpServerTestRequest.md +docs/HttpServerTestResponse.md docs/HttpServerTests.md docs/InstantTest.md docs/InterfaceGroup.md @@ -81,14 +98,16 @@ docs/Monitor.md docs/MonitorType.md docs/MonitorsRequest.md docs/OAuth.md -docs/PageLoadApi.md docs/PageLoadInstantTest.md docs/PageLoadProperties.md docs/PageLoadTest.md +docs/PageLoadTestRequest.md +docs/PageLoadTestResponse.md docs/PageLoadTests.md +docs/PageLoadTestsApi.md docs/PathVisualizationInterfaceGroupsApi.md docs/RequestMethod.md -docs/SIPServerApi.md +docs/SIPServerTestsApi.md docs/SelfLinks.md docs/SensitivityLevel.md docs/Severity.md @@ -96,12 +115,13 @@ docs/SharedWithAccount.md docs/SimpleAgent.md docs/SimpleTest.md docs/SipServerInstantTest.md -docs/SipServerInstantTestRequest.md -docs/SipServerInstantTestResponse.md docs/SipServerProperties.md docs/SipServerTest.md +docs/SipServerTestRequest.md +docs/SipServerTestResponse.md docs/SipServerTests.md docs/SipTestProtocol.md +docs/TestAgentRequest.md docs/TestAuthType.md docs/TestCustomHeaders.md docs/TestDirection.md @@ -125,6 +145,7 @@ docs/TestSslVersionId.md docs/TestSubInterval.md docs/TestType.md docs/Tests.md +docs/TestsApi.md docs/UnauthorizedError.md docs/UnexpandedAgentToAgentTest.md docs/UnexpandedAgentToServerTest.md @@ -141,65 +162,59 @@ docs/UnexpandedSipServerTest.md docs/UnexpandedTest.md docs/UnexpandedVoiceTest.md docs/UnexpandedWebTransactionTest.md -docs/UpdateAgentToAgentTest.md -docs/UpdateAgentToServerTest.md -docs/UpdateApiTest.md -docs/UpdateBgpTest.md docs/UpdateBgpTestRequest.md -docs/UpdateDnsSecTest.md -docs/UpdateDnsServerTest.md -docs/UpdateDnsTraceTest.md -docs/UpdateFtpServerTest.md -docs/UpdateHttpServerTest.md -docs/UpdatePageLoadTest.md docs/UpdateSipServerTest.md -docs/UpdateSipServerTest1.md -docs/UpdateVoiceTest.md -docs/UpdateWebTransactionTest.md docs/ValidationError.md docs/ValidationErrorItem.md -docs/VoiceApi.md docs/VoiceInstantTest.md docs/VoiceProperties.md docs/VoiceTest.md +docs/VoiceTestRequest.md +docs/VoiceTestResponse.md docs/VoiceTests.md -docs/WebTransactionApi.md +docs/VoiceTestsApi.md docs/WebTransactionInstantTest.md docs/WebTransactionProperties.md docs/WebTransactionTest.md +docs/WebTransactionTestRequest.md +docs/WebTransactionTestResponse.md docs/WebTransactionTests.md +docs/WebTransactionTestsApi.md pyproject.toml setup.cfg src/thousandeyes_sdk/tests/__init__.py src/thousandeyes_sdk/tests/api/__init__.py -src/thousandeyes_sdk/tests/api/agent_to_agent_api.py -src/thousandeyes_sdk/tests/api/agent_to_server_api.py -src/thousandeyes_sdk/tests/api/all_test_types_api.py -src/thousandeyes_sdk/tests/api/api_api.py -src/thousandeyes_sdk/tests/api/bgp_api.py -src/thousandeyes_sdk/tests/api/dns_server_api.py -src/thousandeyes_sdk/tests/api/dns_trace_api.py -src/thousandeyes_sdk/tests/api/dnssec_api.py -src/thousandeyes_sdk/tests/api/ftp_server_api.py -src/thousandeyes_sdk/tests/api/http_server_api.py -src/thousandeyes_sdk/tests/api/page_load_api.py +src/thousandeyes_sdk/tests/api/agent_to_agent_tests_api.py +src/thousandeyes_sdk/tests/api/agent_to_server_tests_api.py +src/thousandeyes_sdk/tests/api/api_tests_api.py +src/thousandeyes_sdk/tests/api/bgp_tests_api.py +src/thousandeyes_sdk/tests/api/dns_server_tests_api.py +src/thousandeyes_sdk/tests/api/dns_trace_tests_api.py +src/thousandeyes_sdk/tests/api/dnssec_tests_api.py +src/thousandeyes_sdk/tests/api/ftp_server_tests_api.py +src/thousandeyes_sdk/tests/api/http_server_tests_api.py +src/thousandeyes_sdk/tests/api/page_load_tests_api.py src/thousandeyes_sdk/tests/api/path_visualization_interface_groups_api.py -src/thousandeyes_sdk/tests/api/sip_server_api.py -src/thousandeyes_sdk/tests/api/voice_api.py -src/thousandeyes_sdk/tests/api/web_transaction_api.py +src/thousandeyes_sdk/tests/api/sip_server_tests_api.py +src/thousandeyes_sdk/tests/api/tests_api.py +src/thousandeyes_sdk/tests/api/voice_tests_api.py +src/thousandeyes_sdk/tests/api/web_transaction_tests_api.py src/thousandeyes_sdk/tests/models/__init__.py -src/thousandeyes_sdk/tests/models/agent.py src/thousandeyes_sdk/tests/models/agent_base.py src/thousandeyes_sdk/tests/models/agent_interfaces.py -src/thousandeyes_sdk/tests/models/agent_request.py +src/thousandeyes_sdk/tests/models/agent_response.py src/thousandeyes_sdk/tests/models/agent_to_agent_instant_test.py src/thousandeyes_sdk/tests/models/agent_to_agent_properties.py src/thousandeyes_sdk/tests/models/agent_to_agent_test.py src/thousandeyes_sdk/tests/models/agent_to_agent_test_protocol.py +src/thousandeyes_sdk/tests/models/agent_to_agent_test_request.py +src/thousandeyes_sdk/tests/models/agent_to_agent_test_response.py src/thousandeyes_sdk/tests/models/agent_to_agent_tests.py src/thousandeyes_sdk/tests/models/agent_to_server_instant_test.py src/thousandeyes_sdk/tests/models/agent_to_server_properties.py src/thousandeyes_sdk/tests/models/agent_to_server_test.py +src/thousandeyes_sdk/tests/models/agent_to_server_test_request.py +src/thousandeyes_sdk/tests/models/agent_to_server_test_response.py src/thousandeyes_sdk/tests/models/agent_to_server_tests.py src/thousandeyes_sdk/tests/models/alert_direction.py src/thousandeyes_sdk/tests/models/alert_rounds_violation_mode.py @@ -217,38 +232,53 @@ src/thousandeyes_sdk/tests/models/api_request_header.py src/thousandeyes_sdk/tests/models/api_request_method.py src/thousandeyes_sdk/tests/models/api_request_variable.py src/thousandeyes_sdk/tests/models/api_test.py +src/thousandeyes_sdk/tests/models/api_test_request.py +src/thousandeyes_sdk/tests/models/api_test_response.py src/thousandeyes_sdk/tests/models/api_tests.py src/thousandeyes_sdk/tests/models/base_bgp_test.py src/thousandeyes_sdk/tests/models/base_request.py src/thousandeyes_sdk/tests/models/base_test.py src/thousandeyes_sdk/tests/models/bgp_test.py +src/thousandeyes_sdk/tests/models/bgp_test_request.py +src/thousandeyes_sdk/tests/models/bgp_test_response.py src/thousandeyes_sdk/tests/models/bgp_tests.py src/thousandeyes_sdk/tests/models/cloud_enterprise_agent_type.py src/thousandeyes_sdk/tests/models/dns_query_class.py src/thousandeyes_sdk/tests/models/dns_sec_instant_test.py src/thousandeyes_sdk/tests/models/dns_sec_properties.py src/thousandeyes_sdk/tests/models/dns_sec_test.py +src/thousandeyes_sdk/tests/models/dns_sec_test_request.py +src/thousandeyes_sdk/tests/models/dns_sec_test_response.py src/thousandeyes_sdk/tests/models/dns_sec_tests.py src/thousandeyes_sdk/tests/models/dns_server_instant_test.py src/thousandeyes_sdk/tests/models/dns_server_properties.py src/thousandeyes_sdk/tests/models/dns_server_test.py +src/thousandeyes_sdk/tests/models/dns_server_test_request.py +src/thousandeyes_sdk/tests/models/dns_server_test_response.py src/thousandeyes_sdk/tests/models/dns_server_tests.py src/thousandeyes_sdk/tests/models/dns_servers_request.py src/thousandeyes_sdk/tests/models/dns_trace_instant_test.py src/thousandeyes_sdk/tests/models/dns_trace_properties.py src/thousandeyes_sdk/tests/models/dns_trace_test.py +src/thousandeyes_sdk/tests/models/dns_trace_test_request.py +src/thousandeyes_sdk/tests/models/dns_trace_test_response.py src/thousandeyes_sdk/tests/models/dns_trace_tests.py src/thousandeyes_sdk/tests/models/error.py -src/thousandeyes_sdk/tests/models/expand.py +src/thousandeyes_sdk/tests/models/expand_bgp_test_options.py +src/thousandeyes_sdk/tests/models/expand_test_options.py src/thousandeyes_sdk/tests/models/ftp_server_instant_test.py src/thousandeyes_sdk/tests/models/ftp_server_properties.py src/thousandeyes_sdk/tests/models/ftp_server_request_type.py src/thousandeyes_sdk/tests/models/ftp_server_test.py +src/thousandeyes_sdk/tests/models/ftp_server_test_request.py +src/thousandeyes_sdk/tests/models/ftp_server_test_response.py src/thousandeyes_sdk/tests/models/ftp_server_tests.py src/thousandeyes_sdk/tests/models/http_server_base_properties.py src/thousandeyes_sdk/tests/models/http_server_instant_test.py src/thousandeyes_sdk/tests/models/http_server_properties.py src/thousandeyes_sdk/tests/models/http_server_test.py +src/thousandeyes_sdk/tests/models/http_server_test_request.py +src/thousandeyes_sdk/tests/models/http_server_test_response.py src/thousandeyes_sdk/tests/models/http_server_tests.py src/thousandeyes_sdk/tests/models/instant_test.py src/thousandeyes_sdk/tests/models/interface_group.py @@ -261,6 +291,8 @@ src/thousandeyes_sdk/tests/models/o_auth.py src/thousandeyes_sdk/tests/models/page_load_instant_test.py src/thousandeyes_sdk/tests/models/page_load_properties.py src/thousandeyes_sdk/tests/models/page_load_test.py +src/thousandeyes_sdk/tests/models/page_load_test_request.py +src/thousandeyes_sdk/tests/models/page_load_test_response.py src/thousandeyes_sdk/tests/models/page_load_tests.py src/thousandeyes_sdk/tests/models/request_method.py src/thousandeyes_sdk/tests/models/self_links.py @@ -270,12 +302,13 @@ src/thousandeyes_sdk/tests/models/shared_with_account.py src/thousandeyes_sdk/tests/models/simple_agent.py src/thousandeyes_sdk/tests/models/simple_test.py src/thousandeyes_sdk/tests/models/sip_server_instant_test.py -src/thousandeyes_sdk/tests/models/sip_server_instant_test_request.py -src/thousandeyes_sdk/tests/models/sip_server_instant_test_response.py src/thousandeyes_sdk/tests/models/sip_server_properties.py src/thousandeyes_sdk/tests/models/sip_server_test.py +src/thousandeyes_sdk/tests/models/sip_server_test_request.py +src/thousandeyes_sdk/tests/models/sip_server_test_response.py src/thousandeyes_sdk/tests/models/sip_server_tests.py src/thousandeyes_sdk/tests/models/sip_test_protocol.py +src/thousandeyes_sdk/tests/models/test_agent_request.py src/thousandeyes_sdk/tests/models/test_auth_type.py src/thousandeyes_sdk/tests/models/test_custom_headers.py src/thousandeyes_sdk/tests/models/test_direction.py @@ -315,46 +348,37 @@ src/thousandeyes_sdk/tests/models/unexpanded_sip_server_test.py src/thousandeyes_sdk/tests/models/unexpanded_test.py src/thousandeyes_sdk/tests/models/unexpanded_voice_test.py src/thousandeyes_sdk/tests/models/unexpanded_web_transaction_test.py -src/thousandeyes_sdk/tests/models/update_agent_to_agent_test.py -src/thousandeyes_sdk/tests/models/update_agent_to_server_test.py -src/thousandeyes_sdk/tests/models/update_api_test.py -src/thousandeyes_sdk/tests/models/update_bgp_test.py src/thousandeyes_sdk/tests/models/update_bgp_test_request.py -src/thousandeyes_sdk/tests/models/update_dns_sec_test.py -src/thousandeyes_sdk/tests/models/update_dns_server_test.py -src/thousandeyes_sdk/tests/models/update_dns_trace_test.py -src/thousandeyes_sdk/tests/models/update_ftp_server_test.py -src/thousandeyes_sdk/tests/models/update_http_server_test.py -src/thousandeyes_sdk/tests/models/update_page_load_test.py src/thousandeyes_sdk/tests/models/update_sip_server_test.py -src/thousandeyes_sdk/tests/models/update_sip_server_test1.py -src/thousandeyes_sdk/tests/models/update_voice_test.py -src/thousandeyes_sdk/tests/models/update_web_transaction_test.py src/thousandeyes_sdk/tests/models/validation_error.py src/thousandeyes_sdk/tests/models/validation_error_item.py src/thousandeyes_sdk/tests/models/voice_instant_test.py src/thousandeyes_sdk/tests/models/voice_properties.py src/thousandeyes_sdk/tests/models/voice_test.py +src/thousandeyes_sdk/tests/models/voice_test_request.py +src/thousandeyes_sdk/tests/models/voice_test_response.py src/thousandeyes_sdk/tests/models/voice_tests.py src/thousandeyes_sdk/tests/models/web_transaction_instant_test.py src/thousandeyes_sdk/tests/models/web_transaction_properties.py src/thousandeyes_sdk/tests/models/web_transaction_test.py +src/thousandeyes_sdk/tests/models/web_transaction_test_request.py +src/thousandeyes_sdk/tests/models/web_transaction_test_response.py src/thousandeyes_sdk/tests/models/web_transaction_tests.py src/thousandeyes_sdk/tests/py.typed test/__init__.py -test/test_agent_to_agent_api.py -test/test_agent_to_server_api.py -test/test_all_test_types_api.py -test/test_api_api.py -test/test_bgp_api.py -test/test_dns_server_api.py -test/test_dns_trace_api.py -test/test_dnssec_api.py -test/test_ftp_server_api.py -test/test_http_server_api.py -test/test_page_load_api.py +test/test_agent_to_agent_tests_api.py +test/test_agent_to_server_tests_api.py +test/test_api_tests_api.py +test/test_bgp_tests_api.py +test/test_dns_server_tests_api.py +test/test_dns_trace_tests_api.py +test/test_dnssec_tests_api.py +test/test_ftp_server_tests_api.py +test/test_http_server_tests_api.py +test/test_page_load_tests_api.py test/test_path_visualization_interface_groups_api.py -test/test_sip_server_api.py +test/test_sip_server_tests_api.py +test/test_tests_api.py test/test_utils.py -test/test_voice_api.py -test/test_web_transaction_api.py +test/test_voice_tests_api.py +test/test_web_transaction_tests_api.py diff --git a/thousandeyes-sdk-tests/README.md b/thousandeyes-sdk-tests/README.md index 408b54263..ed495acd5 100644 --- a/thousandeyes-sdk-tests/README.md +++ b/thousandeyes-sdk-tests/README.md @@ -4,7 +4,7 @@ This API supports listing, creating, editing, and deleting Cloud and Enterprise This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -76,18 +76,18 @@ configuration = thousandeyes_sdk.core.Configuration( # Enter a context with an instance of the API client with thousandeyes_sdk.core.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.tests.APIApi(api_client) - update_api_test = thousandeyes_sdk.tests.UpdateApiTest() # UpdateApiTest | + api_instance = thousandeyes_sdk.tests.APITestsApi(api_client) + api_test_request = thousandeyes_sdk.tests.ApiTestRequest() # ApiTestRequest | aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) - expand = [thousandeyes_sdk.tests.Expand()] # List[Expand] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) try: # Create API test - api_response = api_instance.create_api_test(update_api_test, aid=aid, expand=expand) - print("The response of APIApi->create_api_test:\n") + api_response = api_instance.create_api_test(api_test_request, aid=aid, expand=expand) + print("The response of APITestsApi->create_api_test:\n") pprint(api_response) except ApiException as e: - print("Exception when calling APIApi->create_api_test: %s\n" % e) + print("Exception when calling APITestsApi->create_api_test: %s\n" % e) ``` @@ -97,92 +97,95 @@ All URIs are relative to *https://api.thousandeyes.com/v7* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*APIApi* | [**create_api_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/APIApi.md#create_api_test) | **POST** /tests/api | Create API test -*APIApi* | [**delete_api_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/APIApi.md#delete_api_test) | **DELETE** /tests/api/{testId} | Delete API test -*APIApi* | [**get_api_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/APIApi.md#get_api_test) | **GET** /tests/api/{testId} | Get API test -*APIApi* | [**get_api_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/APIApi.md#get_api_tests) | **GET** /tests/api | List API tests -*APIApi* | [**update_api_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/APIApi.md#update_api_test) | **PUT** /tests/api/{testId} | Update API test -*AgentToAgentApi* | [**create_agent_to_agent_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToAgentApi.md#create_agent_to_agent_test) | **POST** /tests/agent-to-agent | Create Agent to Agent test -*AgentToAgentApi* | [**delete_agent_to_agent_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToAgentApi.md#delete_agent_to_agent_test) | **DELETE** /tests/agent-to-agent/{testId} | Delete Agent to Agent test -*AgentToAgentApi* | [**get_agent_to_agent_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToAgentApi.md#get_agent_to_agent_test) | **GET** /tests/agent-to-agent/{testId} | Get Agent to Agent test -*AgentToAgentApi* | [**get_agent_to_agent_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToAgentApi.md#get_agent_to_agent_tests) | **GET** /tests/agent-to-agent | List Agent to Agent tests -*AgentToAgentApi* | [**update_agent_to_agent_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToAgentApi.md#update_agent_to_agent_test) | **PUT** /tests/agent-to-agent/{testId} | Update Agent to Agent test -*AgentToServerApi* | [**create_agent_to_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToServerApi.md#create_agent_to_server_test) | **POST** /tests/agent-to-server | Create Agent to Server test -*AgentToServerApi* | [**delete_agent_to_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToServerApi.md#delete_agent_to_server_test) | **DELETE** /tests/agent-to-server/{testId} | Delete Agent to Server test -*AgentToServerApi* | [**get_agent_to_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToServerApi.md#get_agent_to_server_test) | **GET** /tests/agent-to-server/{testId} | Get Agent to Server test -*AgentToServerApi* | [**get_agent_to_server_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToServerApi.md#get_agent_to_server_tests) | **GET** /tests/agent-to-server | List Agent to Server tests -*AgentToServerApi* | [**update_agent_to_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToServerApi.md#update_agent_to_server_test) | **PUT** /tests/agent-to-server/{testId} | Update Agent to Server test -*AllTestTypesApi* | [**get_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AllTestTypesApi.md#get_tests) | **GET** /tests | List configured tests -*BGPApi* | [**create_bgp_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/BGPApi.md#create_bgp_test) | **POST** /tests/bgp | Create BGP test -*BGPApi* | [**delete_bgp_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/BGPApi.md#delete_bgp_test) | **DELETE** /tests/bgp/{testId} | Delete BGP test -*BGPApi* | [**get_bgp_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/BGPApi.md#get_bgp_test) | **GET** /tests/bgp/{testId} | Get BGP test -*BGPApi* | [**get_bgp_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/BGPApi.md#get_bgp_tests) | **GET** /tests/bgp | List BGP tests -*BGPApi* | [**update_bgp_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/BGPApi.md#update_bgp_test) | **PUT** /tests/bgp/{testId} | Update BGP test -*DNSSECApi* | [**create_dns_sec_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSSECApi.md#create_dns_sec_test) | **POST** /tests/dnssec | Create DNSSEC test -*DNSSECApi* | [**delete_dns_sec_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSSECApi.md#delete_dns_sec_test) | **DELETE** /tests/dnssec/{testId} | Delete DNSSEC test -*DNSSECApi* | [**get_dns_sec_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSSECApi.md#get_dns_sec_test) | **GET** /tests/dnssec/{testId} | Get DNSSEC test -*DNSSECApi* | [**get_dns_sec_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSSECApi.md#get_dns_sec_tests) | **GET** /tests/dnssec | List DNSSEC tests -*DNSSECApi* | [**update_dns_sec_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSSECApi.md#update_dns_sec_test) | **PUT** /tests/dnssec/{testId} | Update DNSSEC test -*DNSServerApi* | [**create_dns_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSServerApi.md#create_dns_server_test) | **POST** /tests/dns-server | Create DNS Server test -*DNSServerApi* | [**delete_dns_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSServerApi.md#delete_dns_server_test) | **DELETE** /tests/dns-server/{testId} | Delete DNS Server test -*DNSServerApi* | [**get_dns_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSServerApi.md#get_dns_server_test) | **GET** /tests/dns-server/{testId} | Get DNS Server test -*DNSServerApi* | [**get_dns_server_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSServerApi.md#get_dns_server_tests) | **GET** /tests/dns-server | List DNS Server tests -*DNSServerApi* | [**update_dns_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSServerApi.md#update_dns_server_test) | **PUT** /tests/dns-server/{testId} | Update DNS Server test -*DNSTraceApi* | [**create_dns_trace_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSTraceApi.md#create_dns_trace_test) | **POST** /tests/dns-trace | Create DNS Trace test -*DNSTraceApi* | [**delete_dns_trace_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSTraceApi.md#delete_dns_trace_test) | **DELETE** /tests/dns-trace/{testId} | Delete DNS Trace test -*DNSTraceApi* | [**get_dns_trace_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSTraceApi.md#get_dns_trace_test) | **GET** /tests/dns-trace/{testId} | Get DNS Trace test -*DNSTraceApi* | [**get_dns_trace_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSTraceApi.md#get_dns_trace_tests) | **GET** /tests/dns-trace | List DNS Trace tests -*DNSTraceApi* | [**update_dns_trace_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSTraceApi.md#update_dns_trace_test) | **PUT** /tests/dns-trace/{testId} | Update DNS Trace test -*FTPServerApi* | [**create_ftp_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/FTPServerApi.md#create_ftp_server_test) | **POST** /tests/ftp-server | Create FTP Server test -*FTPServerApi* | [**delete_ftp_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/FTPServerApi.md#delete_ftp_server_test) | **DELETE** /tests/ftp-server/{testId} | Delete FTP Server test -*FTPServerApi* | [**get_ftp_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/FTPServerApi.md#get_ftp_server_test) | **GET** /tests/ftp-server/{testId} | Get FTP Server test -*FTPServerApi* | [**get_ftp_server_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/FTPServerApi.md#get_ftp_server_tests) | **GET** /tests/ftp-server | List FTP Server tests -*FTPServerApi* | [**update_ftp_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/FTPServerApi.md#update_ftp_server_test) | **PUT** /tests/ftp-server/{testId} | Update FTP Server test -*HTTPServerApi* | [**create_http_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/HTTPServerApi.md#create_http_server_test) | **POST** /tests/http-server | Create HTTP Server test -*HTTPServerApi* | [**delete_http_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/HTTPServerApi.md#delete_http_server_test) | **DELETE** /tests/http-server/{testId} | Delete HTTP Server test -*HTTPServerApi* | [**get_http_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/HTTPServerApi.md#get_http_server_test) | **GET** /tests/http-server/{testId} | Get HTTP Server test -*HTTPServerApi* | [**get_http_server_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/HTTPServerApi.md#get_http_server_tests) | **GET** /tests/http-server | List HTTP Server tests -*HTTPServerApi* | [**update_http_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/HTTPServerApi.md#update_http_server_test) | **PUT** /tests/http-server/{testId} | Update HTTP Server test -*PageLoadApi* | [**create_page_load_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PageLoadApi.md#create_page_load_test) | **POST** /tests/page-load | Create Page Load test -*PageLoadApi* | [**delete_page_load_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PageLoadApi.md#delete_page_load_test) | **DELETE** /tests/page-load/{testId} | Delete Page Load test -*PageLoadApi* | [**get_page_load_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PageLoadApi.md#get_page_load_test) | **GET** /tests/page-load/{testId} | Get Page Load test -*PageLoadApi* | [**get_page_load_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PageLoadApi.md#get_page_load_tests) | **GET** /tests/page-load | List Page Load tests -*PageLoadApi* | [**update_page_load_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PageLoadApi.md#update_page_load_test) | **PUT** /tests/page-load/{testId} | Update Page Load test +*APITestsApi* | [**create_api_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/APITestsApi.md#create_api_test) | **POST** /tests/api | Create API test +*APITestsApi* | [**delete_api_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/APITestsApi.md#delete_api_test) | **DELETE** /tests/api/{testId} | Delete API test +*APITestsApi* | [**get_api_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/APITestsApi.md#get_api_test) | **GET** /tests/api/{testId} | Get API test +*APITestsApi* | [**get_api_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/APITestsApi.md#get_api_tests) | **GET** /tests/api | List API tests +*APITestsApi* | [**update_api_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/APITestsApi.md#update_api_test) | **PUT** /tests/api/{testId} | Update API test +*AgentToAgentTestsApi* | [**create_agent_to_agent_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToAgentTestsApi.md#create_agent_to_agent_test) | **POST** /tests/agent-to-agent | Create Agent to Agent test +*AgentToAgentTestsApi* | [**delete_agent_to_agent_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToAgentTestsApi.md#delete_agent_to_agent_test) | **DELETE** /tests/agent-to-agent/{testId} | Delete Agent to Agent test +*AgentToAgentTestsApi* | [**get_agent_to_agent_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToAgentTestsApi.md#get_agent_to_agent_test) | **GET** /tests/agent-to-agent/{testId} | Get Agent to Agent test +*AgentToAgentTestsApi* | [**get_agent_to_agent_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToAgentTestsApi.md#get_agent_to_agent_tests) | **GET** /tests/agent-to-agent | List Agent to Agent tests +*AgentToAgentTestsApi* | [**update_agent_to_agent_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToAgentTestsApi.md#update_agent_to_agent_test) | **PUT** /tests/agent-to-agent/{testId} | Update Agent to Agent test +*AgentToServerTestsApi* | [**create_agent_to_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToServerTestsApi.md#create_agent_to_server_test) | **POST** /tests/agent-to-server | Create Agent to Server test +*AgentToServerTestsApi* | [**delete_agent_to_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToServerTestsApi.md#delete_agent_to_server_test) | **DELETE** /tests/agent-to-server/{testId} | Delete Agent to Server test +*AgentToServerTestsApi* | [**get_agent_to_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToServerTestsApi.md#get_agent_to_server_test) | **GET** /tests/agent-to-server/{testId} | Get Agent to Server test +*AgentToServerTestsApi* | [**get_agent_to_server_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToServerTestsApi.md#get_agent_to_server_tests) | **GET** /tests/agent-to-server | List Agent to Server tests +*AgentToServerTestsApi* | [**update_agent_to_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToServerTestsApi.md#update_agent_to_server_test) | **PUT** /tests/agent-to-server/{testId} | Update Agent to Server test +*BGPTestsApi* | [**create_bgp_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/BGPTestsApi.md#create_bgp_test) | **POST** /tests/bgp | Create BGP test +*BGPTestsApi* | [**delete_bgp_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/BGPTestsApi.md#delete_bgp_test) | **DELETE** /tests/bgp/{testId} | Delete BGP test +*BGPTestsApi* | [**get_bgp_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/BGPTestsApi.md#get_bgp_test) | **GET** /tests/bgp/{testId} | Get BGP test +*BGPTestsApi* | [**get_bgp_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/BGPTestsApi.md#get_bgp_tests) | **GET** /tests/bgp | List BGP tests +*BGPTestsApi* | [**update_bgp_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/BGPTestsApi.md#update_bgp_test) | **PUT** /tests/bgp/{testId} | Update BGP test +*DNSSECTestsApi* | [**create_dns_sec_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSSECTestsApi.md#create_dns_sec_test) | **POST** /tests/dnssec | Create DNSSEC test +*DNSSECTestsApi* | [**delete_dns_sec_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSSECTestsApi.md#delete_dns_sec_test) | **DELETE** /tests/dnssec/{testId} | Delete DNSSEC test +*DNSSECTestsApi* | [**get_dns_sec_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSSECTestsApi.md#get_dns_sec_test) | **GET** /tests/dnssec/{testId} | Get DNSSEC test +*DNSSECTestsApi* | [**get_dns_sec_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSSECTestsApi.md#get_dns_sec_tests) | **GET** /tests/dnssec | List DNSSEC tests +*DNSSECTestsApi* | [**update_dns_sec_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSSECTestsApi.md#update_dns_sec_test) | **PUT** /tests/dnssec/{testId} | Update DNSSEC test +*DNSServerTestsApi* | [**create_dns_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSServerTestsApi.md#create_dns_server_test) | **POST** /tests/dns-server | Create DNS Server test +*DNSServerTestsApi* | [**delete_dns_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSServerTestsApi.md#delete_dns_server_test) | **DELETE** /tests/dns-server/{testId} | Delete DNS Server test +*DNSServerTestsApi* | [**get_dns_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSServerTestsApi.md#get_dns_server_test) | **GET** /tests/dns-server/{testId} | Get DNS Server test +*DNSServerTestsApi* | [**get_dns_server_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSServerTestsApi.md#get_dns_server_tests) | **GET** /tests/dns-server | List DNS Server tests +*DNSServerTestsApi* | [**update_dns_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSServerTestsApi.md#update_dns_server_test) | **PUT** /tests/dns-server/{testId} | Update DNS Server test +*DNSTraceTestsApi* | [**create_dns_trace_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSTraceTestsApi.md#create_dns_trace_test) | **POST** /tests/dns-trace | Create DNS Trace test +*DNSTraceTestsApi* | [**delete_dns_trace_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSTraceTestsApi.md#delete_dns_trace_test) | **DELETE** /tests/dns-trace/{testId} | Delete DNS Trace test +*DNSTraceTestsApi* | [**get_dns_trace_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSTraceTestsApi.md#get_dns_trace_test) | **GET** /tests/dns-trace/{testId} | Get DNS Trace test +*DNSTraceTestsApi* | [**get_dns_trace_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSTraceTestsApi.md#get_dns_trace_tests) | **GET** /tests/dns-trace | List DNS Trace tests +*DNSTraceTestsApi* | [**update_dns_trace_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DNSTraceTestsApi.md#update_dns_trace_test) | **PUT** /tests/dns-trace/{testId} | Update DNS Trace test +*FTPServerTestsApi* | [**create_ftp_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/FTPServerTestsApi.md#create_ftp_server_test) | **POST** /tests/ftp-server | Create FTP Server test +*FTPServerTestsApi* | [**delete_ftp_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/FTPServerTestsApi.md#delete_ftp_server_test) | **DELETE** /tests/ftp-server/{testId} | Delete FTP Server test +*FTPServerTestsApi* | [**get_ftp_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/FTPServerTestsApi.md#get_ftp_server_test) | **GET** /tests/ftp-server/{testId} | Get FTP Server test +*FTPServerTestsApi* | [**get_ftp_server_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/FTPServerTestsApi.md#get_ftp_server_tests) | **GET** /tests/ftp-server | List FTP Server tests +*FTPServerTestsApi* | [**update_ftp_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/FTPServerTestsApi.md#update_ftp_server_test) | **PUT** /tests/ftp-server/{testId} | Update FTP Server test +*HTTPServerTestsApi* | [**create_http_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/HTTPServerTestsApi.md#create_http_server_test) | **POST** /tests/http-server | Create HTTP Server test +*HTTPServerTestsApi* | [**delete_http_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/HTTPServerTestsApi.md#delete_http_server_test) | **DELETE** /tests/http-server/{testId} | Delete HTTP Server test +*HTTPServerTestsApi* | [**get_http_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/HTTPServerTestsApi.md#get_http_server_test) | **GET** /tests/http-server/{testId} | Get HTTP Server test +*HTTPServerTestsApi* | [**get_http_server_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/HTTPServerTestsApi.md#get_http_server_tests) | **GET** /tests/http-server | List HTTP Server tests +*HTTPServerTestsApi* | [**update_http_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/HTTPServerTestsApi.md#update_http_server_test) | **PUT** /tests/http-server/{testId} | Update HTTP Server test +*PageLoadTestsApi* | [**create_page_load_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PageLoadTestsApi.md#create_page_load_test) | **POST** /tests/page-load | Create Page Load test +*PageLoadTestsApi* | [**delete_page_load_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PageLoadTestsApi.md#delete_page_load_test) | **DELETE** /tests/page-load/{testId} | Delete Page Load test +*PageLoadTestsApi* | [**get_page_load_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PageLoadTestsApi.md#get_page_load_test) | **GET** /tests/page-load/{testId} | Get Page Load test +*PageLoadTestsApi* | [**get_page_load_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PageLoadTestsApi.md#get_page_load_tests) | **GET** /tests/page-load | List Page Load tests +*PageLoadTestsApi* | [**update_page_load_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PageLoadTestsApi.md#update_page_load_test) | **PUT** /tests/page-load/{testId} | Update Page Load test *PathVisualizationInterfaceGroupsApi* | [**create_path_vis_interface_groups**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PathVisualizationInterfaceGroupsApi.md#create_path_vis_interface_groups) | **POST** /network/path-vis/interface-groups | Create interface group for path visualization *PathVisualizationInterfaceGroupsApi* | [**delete_path_vis_interface_group**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PathVisualizationInterfaceGroupsApi.md#delete_path_vis_interface_group) | **DELETE** /network/path-vis/interface-groups/{interfaceGroupId} | Delete interface group *PathVisualizationInterfaceGroupsApi* | [**get_path_vis_interface_groups**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PathVisualizationInterfaceGroupsApi.md#get_path_vis_interface_groups) | **GET** /network/path-vis/interface-groups | List interface groups for path visualization *PathVisualizationInterfaceGroupsApi* | [**update_path_vis_interface_group**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PathVisualizationInterfaceGroupsApi.md#update_path_vis_interface_group) | **PUT** /network/path-vis/interface-groups/{interfaceGroupId} | Update interface group -*SIPServerApi* | [**create_sip_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SIPServerApi.md#create_sip_server_test) | **POST** /tests/sip-server | Create SIP Server test -*SIPServerApi* | [**delete_sip_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SIPServerApi.md#delete_sip_server_test) | **DELETE** /tests/sip-server/{testId} | Delete SIP Server test -*SIPServerApi* | [**get_sip_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SIPServerApi.md#get_sip_server_test) | **GET** /tests/sip-server/{testId} | Get SIP Server test -*SIPServerApi* | [**get_sip_server_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SIPServerApi.md#get_sip_server_tests) | **GET** /tests/sip-server | List SIP Server tests -*SIPServerApi* | [**update_sip_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SIPServerApi.md#update_sip_server_test) | **PUT** /tests/sip-server/{testId} | Update SIP Server test -*VoiceApi* | [**create_voice_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/VoiceApi.md#create_voice_test) | **POST** /tests/voice | Create Voice test -*VoiceApi* | [**delete_voice_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/VoiceApi.md#delete_voice_test) | **DELETE** /tests/voice/{testId} | Delete Voice test -*VoiceApi* | [**get_voice_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/VoiceApi.md#get_voice_test) | **GET** /tests/voice/{testId} | Get Voice test -*VoiceApi* | [**get_voice_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/VoiceApi.md#get_voice_tests) | **GET** /tests/voice | List Voice tests -*VoiceApi* | [**update_voice_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/VoiceApi.md#update_voice_test) | **PUT** /tests/voice/{testId} | Update Voice test -*WebTransactionApi* | [**create_web_transactions_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/WebTransactionApi.md#create_web_transactions_test) | **POST** /tests/web-transactions | Create Web Transactions test -*WebTransactionApi* | [**delete_web_transactions_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/WebTransactionApi.md#delete_web_transactions_test) | **DELETE** /tests/web-transactions/{testId} | Delete Web Transactions test -*WebTransactionApi* | [**get_web_transactions_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/WebTransactionApi.md#get_web_transactions_test) | **GET** /tests/web-transactions/{testId} | Get Web Transactions test -*WebTransactionApi* | [**get_web_transactions_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/WebTransactionApi.md#get_web_transactions_tests) | **GET** /tests/web-transactions | List Web Transactions tests -*WebTransactionApi* | [**update_web_transactions_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/WebTransactionApi.md#update_web_transactions_test) | **PUT** /tests/web-transactions/{testId} | Update Web Transactions test +*SIPServerTestsApi* | [**create_sip_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SIPServerTestsApi.md#create_sip_server_test) | **POST** /tests/sip-server | Create SIP Server test +*SIPServerTestsApi* | [**delete_sip_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SIPServerTestsApi.md#delete_sip_server_test) | **DELETE** /tests/sip-server/{testId} | Delete SIP Server test +*SIPServerTestsApi* | [**get_sip_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SIPServerTestsApi.md#get_sip_server_test) | **GET** /tests/sip-server/{testId} | Get SIP Server test +*SIPServerTestsApi* | [**get_sip_server_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SIPServerTestsApi.md#get_sip_server_tests) | **GET** /tests/sip-server | List SIP Server tests +*SIPServerTestsApi* | [**update_sip_server_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SIPServerTestsApi.md#update_sip_server_test) | **PUT** /tests/sip-server/{testId} | Update SIP Server test +*TestsApi* | [**get_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/TestsApi.md#get_tests) | **GET** /tests | List configured tests +*VoiceTestsApi* | [**create_voice_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/VoiceTestsApi.md#create_voice_test) | **POST** /tests/voice | Create Voice test +*VoiceTestsApi* | [**delete_voice_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/VoiceTestsApi.md#delete_voice_test) | **DELETE** /tests/voice/{testId} | Delete Voice test +*VoiceTestsApi* | [**get_voice_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/VoiceTestsApi.md#get_voice_test) | **GET** /tests/voice/{testId} | Get Voice test +*VoiceTestsApi* | [**get_voice_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/VoiceTestsApi.md#get_voice_tests) | **GET** /tests/voice | List Voice tests +*VoiceTestsApi* | [**update_voice_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/VoiceTestsApi.md#update_voice_test) | **PUT** /tests/voice/{testId} | Update Voice test +*WebTransactionTestsApi* | [**create_web_transactions_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/WebTransactionTestsApi.md#create_web_transactions_test) | **POST** /tests/web-transactions | Create Web Transactions test +*WebTransactionTestsApi* | [**delete_web_transactions_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/WebTransactionTestsApi.md#delete_web_transactions_test) | **DELETE** /tests/web-transactions/{testId} | Delete Web Transactions test +*WebTransactionTestsApi* | [**get_web_transactions_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/WebTransactionTestsApi.md#get_web_transactions_test) | **GET** /tests/web-transactions/{testId} | Get Web Transactions test +*WebTransactionTestsApi* | [**get_web_transactions_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/WebTransactionTestsApi.md#get_web_transactions_tests) | **GET** /tests/web-transactions | List Web Transactions tests +*WebTransactionTestsApi* | [**update_web_transactions_test**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/WebTransactionTestsApi.md#update_web_transactions_test) | **PUT** /tests/web-transactions/{testId} | Update Web Transactions test ## Documentation For Models - - [Agent](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/Agent.md) - [AgentBase](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentBase.md) - [AgentInterfaces](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentInterfaces.md) - - [AgentRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentRequest.md) + - [AgentResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentResponse.md) - [AgentToAgentInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToAgentInstantTest.md) - [AgentToAgentProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToAgentProperties.md) - [AgentToAgentTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToAgentTest.md) - [AgentToAgentTestProtocol](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToAgentTestProtocol.md) + - [AgentToAgentTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToAgentTestRequest.md) + - [AgentToAgentTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToAgentTestResponse.md) - [AgentToAgentTests](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToAgentTests.md) - [AgentToServerInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToServerInstantTest.md) - [AgentToServerProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToServerProperties.md) - [AgentToServerTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToServerTest.md) + - [AgentToServerTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToServerTestRequest.md) + - [AgentToServerTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToServerTestResponse.md) - [AgentToServerTests](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AgentToServerTests.md) - [AlertDirection](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AlertDirection.md) - [AlertRoundsViolationMode](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/AlertRoundsViolationMode.md) @@ -200,38 +203,53 @@ Class | Method | HTTP request | Description - [ApiRequestMethod](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/ApiRequestMethod.md) - [ApiRequestVariable](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/ApiRequestVariable.md) - [ApiTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/ApiTest.md) + - [ApiTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/ApiTestRequest.md) + - [ApiTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/ApiTestResponse.md) - [ApiTests](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/ApiTests.md) - [BaseBgpTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/BaseBgpTest.md) - [BaseRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/BaseRequest.md) - [BaseTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/BaseTest.md) - [BgpTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/BgpTest.md) + - [BgpTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/BgpTestRequest.md) + - [BgpTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/BgpTestResponse.md) - [BgpTests](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/BgpTests.md) - [CloudEnterpriseAgentType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/CloudEnterpriseAgentType.md) - [DnsQueryClass](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsQueryClass.md) - [DnsSecInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsSecInstantTest.md) - [DnsSecProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsSecProperties.md) - [DnsSecTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsSecTest.md) + - [DnsSecTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsSecTestRequest.md) + - [DnsSecTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsSecTestResponse.md) - [DnsSecTests](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsSecTests.md) - [DnsServerInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsServerInstantTest.md) - [DnsServerProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsServerProperties.md) - [DnsServerTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsServerTest.md) + - [DnsServerTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsServerTestRequest.md) + - [DnsServerTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsServerTestResponse.md) - [DnsServerTests](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsServerTests.md) - [DnsServersRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsServersRequest.md) - [DnsTraceInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsTraceInstantTest.md) - [DnsTraceProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsTraceProperties.md) - [DnsTraceTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsTraceTest.md) + - [DnsTraceTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsTraceTestRequest.md) + - [DnsTraceTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsTraceTestResponse.md) - [DnsTraceTests](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/DnsTraceTests.md) - [Error](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/Error.md) - - [Expand](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/Expand.md) + - [ExpandBgpTestOptions](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/ExpandBgpTestOptions.md) + - [ExpandTestOptions](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/ExpandTestOptions.md) - [FtpServerInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/FtpServerInstantTest.md) - [FtpServerProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/FtpServerProperties.md) - [FtpServerRequestType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/FtpServerRequestType.md) - [FtpServerTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/FtpServerTest.md) + - [FtpServerTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/FtpServerTestRequest.md) + - [FtpServerTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/FtpServerTestResponse.md) - [FtpServerTests](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/FtpServerTests.md) - [HttpServerBaseProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/HttpServerBaseProperties.md) - [HttpServerInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/HttpServerInstantTest.md) - [HttpServerProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/HttpServerProperties.md) - [HttpServerTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/HttpServerTest.md) + - [HttpServerTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/HttpServerTestRequest.md) + - [HttpServerTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/HttpServerTestResponse.md) - [HttpServerTests](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/HttpServerTests.md) - [InstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/InstantTest.md) - [InterfaceGroup](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/InterfaceGroup.md) @@ -244,6 +262,8 @@ Class | Method | HTTP request | Description - [PageLoadInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PageLoadInstantTest.md) - [PageLoadProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PageLoadProperties.md) - [PageLoadTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PageLoadTest.md) + - [PageLoadTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PageLoadTestRequest.md) + - [PageLoadTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PageLoadTestResponse.md) - [PageLoadTests](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/PageLoadTests.md) - [RequestMethod](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/RequestMethod.md) - [SelfLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SelfLinks.md) @@ -253,12 +273,13 @@ Class | Method | HTTP request | Description - [SimpleAgent](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SimpleAgent.md) - [SimpleTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SimpleTest.md) - [SipServerInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SipServerInstantTest.md) - - [SipServerInstantTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SipServerInstantTestRequest.md) - - [SipServerInstantTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SipServerInstantTestResponse.md) - [SipServerProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SipServerProperties.md) - [SipServerTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SipServerTest.md) + - [SipServerTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SipServerTestRequest.md) + - [SipServerTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SipServerTestResponse.md) - [SipServerTests](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SipServerTests.md) - [SipTestProtocol](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/SipTestProtocol.md) + - [TestAgentRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/TestAgentRequest.md) - [TestAuthType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/TestAuthType.md) - [TestCustomHeaders](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/TestCustomHeaders.md) - [TestDirection](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/TestDirection.md) @@ -298,30 +319,21 @@ Class | Method | HTTP request | Description - [UnexpandedTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UnexpandedTest.md) - [UnexpandedVoiceTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UnexpandedVoiceTest.md) - [UnexpandedWebTransactionTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UnexpandedWebTransactionTest.md) - - [UpdateAgentToAgentTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UpdateAgentToAgentTest.md) - - [UpdateAgentToServerTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UpdateAgentToServerTest.md) - - [UpdateApiTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UpdateApiTest.md) - - [UpdateBgpTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UpdateBgpTest.md) - [UpdateBgpTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UpdateBgpTestRequest.md) - - [UpdateDnsSecTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UpdateDnsSecTest.md) - - [UpdateDnsServerTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UpdateDnsServerTest.md) - - [UpdateDnsTraceTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UpdateDnsTraceTest.md) - - [UpdateFtpServerTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UpdateFtpServerTest.md) - - [UpdateHttpServerTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UpdateHttpServerTest.md) - - [UpdatePageLoadTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UpdatePageLoadTest.md) - [UpdateSipServerTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UpdateSipServerTest.md) - - [UpdateSipServerTest1](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UpdateSipServerTest1.md) - - [UpdateVoiceTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UpdateVoiceTest.md) - - [UpdateWebTransactionTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/UpdateWebTransactionTest.md) - [ValidationError](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/ValidationError.md) - [ValidationErrorItem](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/ValidationErrorItem.md) - [VoiceInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/VoiceInstantTest.md) - [VoiceProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/VoiceProperties.md) - [VoiceTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/VoiceTest.md) + - [VoiceTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/VoiceTestRequest.md) + - [VoiceTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/VoiceTestResponse.md) - [VoiceTests](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/VoiceTests.md) - [WebTransactionInstantTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/WebTransactionInstantTest.md) - [WebTransactionProperties](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/WebTransactionProperties.md) - [WebTransactionTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/WebTransactionTest.md) + - [WebTransactionTestRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/WebTransactionTestRequest.md) + - [WebTransactionTestResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/WebTransactionTestResponse.md) - [WebTransactionTests](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-tests/docs/WebTransactionTests.md) diff --git a/thousandeyes-sdk-tests/docs/APITestsApi.md b/thousandeyes-sdk-tests/docs/APITestsApi.md new file mode 100644 index 000000000..2ddb63c21 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/APITestsApi.md @@ -0,0 +1,458 @@ +# thousandeyes_sdk.tests.APITestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_api_test**](APITestsApi.md#create_api_test) | **POST** /tests/api | Create API test +[**delete_api_test**](APITestsApi.md#delete_api_test) | **DELETE** /tests/api/{testId} | Delete API test +[**get_api_test**](APITestsApi.md#get_api_test) | **GET** /tests/api/{testId} | Get API test +[**get_api_tests**](APITestsApi.md#get_api_tests) | **GET** /tests/api | List API tests +[**update_api_test**](APITestsApi.md#update_api_test) | **PUT** /tests/api/{testId} | Update API test + + +# **create_api_test** +> ApiTestResponse create_api_test(api_test_request, aid=aid, expand=expand) + +Create API test + +Creates a new API test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.api_test_request import ApiTestRequest +from thousandeyes_sdk.tests.models.api_test_response import ApiTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.APITestsApi(api_client) + api_test_request = thousandeyes_sdk.tests.ApiTestRequest() # ApiTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create API test + api_response = api_instance.create_api_test(api_test_request, aid=aid, expand=expand) + print("The response of APITestsApi->create_api_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling APITestsApi->create_api_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **api_test_request** | [**ApiTestRequest**](ApiTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**ApiTestResponse**](ApiTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_api_test** +> delete_api_test(test_id, aid=aid) + +Delete API test + +Deletes the specified API test. This method requires write permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.APITestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete API test + api_instance.delete_api_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling APITestsApi->delete_api_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_api_test** +> ApiTestResponse get_api_test(test_id, aid=aid, expand=expand) + +Get API test + +Returns details for a API test configuration. Please use `expand` parameter to access sub-resources such as alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.api_test_response import ApiTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.APITestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get API test + api_response = api_instance.get_api_test(test_id, aid=aid, expand=expand) + print("The response of APITestsApi->get_api_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling APITestsApi->get_api_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**ApiTestResponse**](ApiTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_api_tests** +> ApiTests get_api_tests(aid=aid) + +List API tests + +Returns a list of all API tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.api_tests import ApiTests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.APITestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List API tests + api_response = api_instance.get_api_tests(aid=aid) + print("The response of APITestsApi->get_api_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling APITestsApi->get_api_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**ApiTests**](ApiTests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_api_test** +> ApiTestResponse update_api_test(test_id, api_test_request, aid=aid, expand=expand) + +Update API test + +Updates an API test. The target test cannot be a live share or saved event. This method requires write permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.api_test_request import ApiTestRequest +from thousandeyes_sdk.tests.models.api_test_response import ApiTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.APITestsApi(api_client) + test_id = '202701' # str | Test ID + api_test_request = thousandeyes_sdk.tests.ApiTestRequest() # ApiTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update API test + api_response = api_instance.update_api_test(test_id, api_test_request, aid=aid, expand=expand) + print("The response of APITestsApi->update_api_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling APITestsApi->update_api_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **api_test_request** | [**ApiTestRequest**](ApiTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**ApiTestResponse**](ApiTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-tests/docs/AgentResponse.md b/thousandeyes-sdk-tests/docs/AgentResponse.md new file mode 100644 index 000000000..cbd4b5cae --- /dev/null +++ b/thousandeyes-sdk-tests/docs/AgentResponse.md @@ -0,0 +1,39 @@ +# AgentResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly] +**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly] +**network** | **str** | Network (including ASN) of agent’s public IP. | [optional] [readonly] +**agent_id** | **str** | Unique ID of the agent. | [optional] [readonly] +**agent_name** | **str** | Name of the agent. | [optional] +**location** | **str** | Location of the agent. | [optional] [readonly] +**country_id** | **str** | 2-digit ISO country code | [optional] [readonly] +**enabled** | **bool** | Flag indicating if the agent is enabled. | [optional] +**prefix** | **str** | Prefix containing agents public IP address. | [optional] [readonly] +**verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly] +**agent_type** | [**CloudEnterpriseAgentType**](CloudEnterpriseAgentType.md) | | + +## Example + +```python +from thousandeyes_sdk.tests.models.agent_response import AgentResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentResponse from a JSON string +agent_response_instance = AgentResponse.from_json(json) +# print the JSON string representation of the object +print(AgentResponse.to_json()) + +# convert the object into a dict +agent_response_dict = agent_response_instance.to_dict() +# create an instance of AgentResponse from a dict +agent_response_from_dict = AgentResponse.from_dict(agent_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/AgentToAgentInstantTest.md b/thousandeyes-sdk-tests/docs/AgentToAgentInstantTest.md index 2567a7ac8..569ef6691 100644 --- a/thousandeyes-sdk-tests/docs/AgentToAgentInstantTest.md +++ b/thousandeyes-sdk-tests/docs/AgentToAgentInstantTest.md @@ -31,7 +31,6 @@ Name | Type | Description | Notes **throughput_duration** | **int** | The throughput duration. | [optional] [default to 10000] **throughput_rate** | **int** | The throughput rate, only applicable for UDP protocol. | [optional] **fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-tests/docs/AgentToAgentTest.md b/thousandeyes-sdk-tests/docs/AgentToAgentTest.md index 438f354dc..930d4cb92 100644 --- a/thousandeyes-sdk-tests/docs/AgentToAgentTest.md +++ b/thousandeyes-sdk-tests/docs/AgentToAgentTest.md @@ -35,7 +35,6 @@ Name | Type | Description | Notes **throughput_duration** | **int** | The throughput duration. | [optional] [default to 10000] **throughput_rate** | **int** | The throughput rate, only applicable for UDP protocol. | [optional] **fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] **bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] **use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] **monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] diff --git a/thousandeyes-sdk-tests/docs/AgentToAgentTestRequest.md b/thousandeyes-sdk-tests/docs/AgentToAgentTestRequest.md new file mode 100644 index 000000000..bd993df13 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/AgentToAgentTestRequest.md @@ -0,0 +1,62 @@ +# AgentToAgentTestRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**mss** | **int** | Maximum segment size, in bytes. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**protocol** | [**AgentToAgentTestProtocol**](AgentToAgentTestProtocol.md) | | [optional] +**target_agent_id** | **str** | `agentId` of the target agent for the test. | +**throughput_measurements** | **bool** | Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent. | [optional] [default to False] +**throughput_duration** | **int** | The throughput duration. | [optional] [default to 10000] +**throughput_rate** | **int** | The throughput rate, only applicable for UDP protocol. | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] +**agents** | [**List[TestAgentRequest]**](TestAgentRequest.md) | Contains list of Agent IDs (get `agentId` from `/agents` endpoint). | + +## Example + +```python +from thousandeyes_sdk.tests.models.agent_to_agent_test_request import AgentToAgentTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentToAgentTestRequest from a JSON string +agent_to_agent_test_request_instance = AgentToAgentTestRequest.from_json(json) +# print the JSON string representation of the object +print(AgentToAgentTestRequest.to_json()) + +# convert the object into a dict +agent_to_agent_test_request_dict = agent_to_agent_test_request_instance.to_dict() +# create an instance of AgentToAgentTestRequest from a dict +agent_to_agent_test_request_from_dict = AgentToAgentTestRequest.from_dict(agent_to_agent_test_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/AgentToAgentTestResponse.md b/thousandeyes-sdk-tests/docs/AgentToAgentTestResponse.md new file mode 100644 index 000000000..b9af60db2 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/AgentToAgentTestResponse.md @@ -0,0 +1,62 @@ +# AgentToAgentTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**direction** | [**TestDirection**](TestDirection.md) | | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**mss** | **int** | Maximum segment size, in bytes. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**protocol** | [**AgentToAgentTestProtocol**](AgentToAgentTestProtocol.md) | | [optional] +**target_agent_id** | **str** | `agentId` of the target agent for the test. | +**throughput_measurements** | **bool** | Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent. | [optional] [default to False] +**throughput_duration** | **int** | The throughput duration. | [optional] [default to 10000] +**throughput_rate** | **int** | The throughput rate, only applicable for UDP protocol. | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.tests.models.agent_to_agent_test_response import AgentToAgentTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentToAgentTestResponse from a JSON string +agent_to_agent_test_response_instance = AgentToAgentTestResponse.from_json(json) +# print the JSON string representation of the object +print(AgentToAgentTestResponse.to_json()) + +# convert the object into a dict +agent_to_agent_test_response_dict = agent_to_agent_test_response_instance.to_dict() +# create an instance of AgentToAgentTestResponse from a dict +agent_to_agent_test_response_from_dict = AgentToAgentTestResponse.from_dict(agent_to_agent_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/AgentToAgentTestsApi.md b/thousandeyes-sdk-tests/docs/AgentToAgentTestsApi.md new file mode 100644 index 000000000..178dfebe6 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/AgentToAgentTestsApi.md @@ -0,0 +1,458 @@ +# thousandeyes_sdk.tests.AgentToAgentTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_agent_to_agent_test**](AgentToAgentTestsApi.md#create_agent_to_agent_test) | **POST** /tests/agent-to-agent | Create Agent to Agent test +[**delete_agent_to_agent_test**](AgentToAgentTestsApi.md#delete_agent_to_agent_test) | **DELETE** /tests/agent-to-agent/{testId} | Delete Agent to Agent test +[**get_agent_to_agent_test**](AgentToAgentTestsApi.md#get_agent_to_agent_test) | **GET** /tests/agent-to-agent/{testId} | Get Agent to Agent test +[**get_agent_to_agent_tests**](AgentToAgentTestsApi.md#get_agent_to_agent_tests) | **GET** /tests/agent-to-agent | List Agent to Agent tests +[**update_agent_to_agent_test**](AgentToAgentTestsApi.md#update_agent_to_agent_test) | **PUT** /tests/agent-to-agent/{testId} | Update Agent to Agent test + + +# **create_agent_to_agent_test** +> AgentToAgentTestResponse create_agent_to_agent_test(agent_to_agent_test_request, aid=aid, expand=expand) + +Create Agent to Agent test + +Creates a new Agent to Agent test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.agent_to_agent_test_request import AgentToAgentTestRequest +from thousandeyes_sdk.tests.models.agent_to_agent_test_response import AgentToAgentTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.AgentToAgentTestsApi(api_client) + agent_to_agent_test_request = thousandeyes_sdk.tests.AgentToAgentTestRequest() # AgentToAgentTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create Agent to Agent test + api_response = api_instance.create_agent_to_agent_test(agent_to_agent_test_request, aid=aid, expand=expand) + print("The response of AgentToAgentTestsApi->create_agent_to_agent_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToAgentTestsApi->create_agent_to_agent_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_to_agent_test_request** | [**AgentToAgentTestRequest**](AgentToAgentTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**AgentToAgentTestResponse**](AgentToAgentTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_agent_to_agent_test** +> delete_agent_to_agent_test(test_id, aid=aid) + +Delete Agent to Agent test + +Deletes the specified Agent to Agent test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.AgentToAgentTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete Agent to Agent test + api_instance.delete_agent_to_agent_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling AgentToAgentTestsApi->delete_agent_to_agent_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_agent_to_agent_test** +> AgentToAgentTestResponse get_agent_to_agent_test(test_id, aid=aid, expand=expand) + +Get Agent to Agent test + +Returns details for a Agent to Agent test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.agent_to_agent_test_response import AgentToAgentTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.AgentToAgentTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get Agent to Agent test + api_response = api_instance.get_agent_to_agent_test(test_id, aid=aid, expand=expand) + print("The response of AgentToAgentTestsApi->get_agent_to_agent_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToAgentTestsApi->get_agent_to_agent_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**AgentToAgentTestResponse**](AgentToAgentTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_agent_to_agent_tests** +> AgentToAgentTests get_agent_to_agent_tests(aid=aid) + +List Agent to Agent tests + +Returns a list of Agent to Agent tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.agent_to_agent_tests import AgentToAgentTests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.AgentToAgentTestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List Agent to Agent tests + api_response = api_instance.get_agent_to_agent_tests(aid=aid) + print("The response of AgentToAgentTestsApi->get_agent_to_agent_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToAgentTestsApi->get_agent_to_agent_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**AgentToAgentTests**](AgentToAgentTests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_agent_to_agent_test** +> AgentToAgentTestResponse update_agent_to_agent_test(test_id, agent_to_agent_test_request, aid=aid, expand=expand) + +Update Agent to Agent test + +Updates a Agent to Agent test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.agent_to_agent_test_request import AgentToAgentTestRequest +from thousandeyes_sdk.tests.models.agent_to_agent_test_response import AgentToAgentTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.AgentToAgentTestsApi(api_client) + test_id = '202701' # str | Test ID + agent_to_agent_test_request = thousandeyes_sdk.tests.AgentToAgentTestRequest() # AgentToAgentTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update Agent to Agent test + api_response = api_instance.update_agent_to_agent_test(test_id, agent_to_agent_test_request, aid=aid, expand=expand) + print("The response of AgentToAgentTestsApi->update_agent_to_agent_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToAgentTestsApi->update_agent_to_agent_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **agent_to_agent_test_request** | [**AgentToAgentTestRequest**](AgentToAgentTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**AgentToAgentTestResponse**](AgentToAgentTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-tests/docs/AgentToServerInstantTest.md b/thousandeyes-sdk-tests/docs/AgentToServerInstantTest.md index 7d1c6f020..866a68924 100644 --- a/thousandeyes-sdk-tests/docs/AgentToServerInstantTest.md +++ b/thousandeyes-sdk-tests/docs/AgentToServerInstantTest.md @@ -33,7 +33,6 @@ Name | Type | Description | Notes **ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] **ping_payload_size** | **int** | Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests. | [optional] **network_measurements** | **bool** | View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements. | [optional] [default to False] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-tests/docs/AgentToServerTest.md b/thousandeyes-sdk-tests/docs/AgentToServerTest.md index 03dc88a55..d5e2e1475 100644 --- a/thousandeyes-sdk-tests/docs/AgentToServerTest.md +++ b/thousandeyes-sdk-tests/docs/AgentToServerTest.md @@ -37,7 +37,6 @@ Name | Type | Description | Notes **ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] **ping_payload_size** | **int** | Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests. | [optional] **network_measurements** | **bool** | View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements. | [optional] [default to False] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] **bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] **use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] **monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] diff --git a/thousandeyes-sdk-tests/docs/AgentToServerTestRequest.md b/thousandeyes-sdk-tests/docs/AgentToServerTestRequest.md new file mode 100644 index 000000000..174a00bf8 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/AgentToServerTestRequest.md @@ -0,0 +1,64 @@ +# AgentToServerTestRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**continuous_mode** | **bool** | To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. | [optional] +**fixed_packet_rate** | **int** | If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1` | [optional] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**server** | **str** | Target name or IP address. | +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**ping_payload_size** | **int** | Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests. | [optional] +**network_measurements** | **bool** | View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements. | [optional] [default to False] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] +**agents** | [**List[TestAgentRequest]**](TestAgentRequest.md) | Contains list of Agent IDs (get `agentId` from `/agents` endpoint). | + +## Example + +```python +from thousandeyes_sdk.tests.models.agent_to_server_test_request import AgentToServerTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentToServerTestRequest from a JSON string +agent_to_server_test_request_instance = AgentToServerTestRequest.from_json(json) +# print the JSON string representation of the object +print(AgentToServerTestRequest.to_json()) + +# convert the object into a dict +agent_to_server_test_request_dict = agent_to_server_test_request_instance.to_dict() +# create an instance of AgentToServerTestRequest from a dict +agent_to_server_test_request_from_dict = AgentToServerTestRequest.from_dict(agent_to_server_test_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/AgentToServerTestResponse.md b/thousandeyes-sdk-tests/docs/AgentToServerTestResponse.md new file mode 100644 index 000000000..1a0c545b8 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/AgentToServerTestResponse.md @@ -0,0 +1,64 @@ +# AgentToServerTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**continuous_mode** | **bool** | To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. | [optional] +**fixed_packet_rate** | **int** | If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1` | [optional] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**port** | **int** | Target port. | [optional] [default to 49153] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**server** | **str** | Target name or IP address. | +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**ping_payload_size** | **int** | Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests. | [optional] +**network_measurements** | **bool** | View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements. | [optional] [default to False] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.tests.models.agent_to_server_test_response import AgentToServerTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentToServerTestResponse from a JSON string +agent_to_server_test_response_instance = AgentToServerTestResponse.from_json(json) +# print the JSON string representation of the object +print(AgentToServerTestResponse.to_json()) + +# convert the object into a dict +agent_to_server_test_response_dict = agent_to_server_test_response_instance.to_dict() +# create an instance of AgentToServerTestResponse from a dict +agent_to_server_test_response_from_dict = AgentToServerTestResponse.from_dict(agent_to_server_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/AgentToServerTestsApi.md b/thousandeyes-sdk-tests/docs/AgentToServerTestsApi.md new file mode 100644 index 000000000..bd2551273 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/AgentToServerTestsApi.md @@ -0,0 +1,458 @@ +# thousandeyes_sdk.tests.AgentToServerTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_agent_to_server_test**](AgentToServerTestsApi.md#create_agent_to_server_test) | **POST** /tests/agent-to-server | Create Agent to Server test +[**delete_agent_to_server_test**](AgentToServerTestsApi.md#delete_agent_to_server_test) | **DELETE** /tests/agent-to-server/{testId} | Delete Agent to Server test +[**get_agent_to_server_test**](AgentToServerTestsApi.md#get_agent_to_server_test) | **GET** /tests/agent-to-server/{testId} | Get Agent to Server test +[**get_agent_to_server_tests**](AgentToServerTestsApi.md#get_agent_to_server_tests) | **GET** /tests/agent-to-server | List Agent to Server tests +[**update_agent_to_server_test**](AgentToServerTestsApi.md#update_agent_to_server_test) | **PUT** /tests/agent-to-server/{testId} | Update Agent to Server test + + +# **create_agent_to_server_test** +> AgentToServerTestResponse create_agent_to_server_test(agent_to_server_test_request, aid=aid, expand=expand) + +Create Agent to Server test + +Creates a new Agent to Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.agent_to_server_test_request import AgentToServerTestRequest +from thousandeyes_sdk.tests.models.agent_to_server_test_response import AgentToServerTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.AgentToServerTestsApi(api_client) + agent_to_server_test_request = thousandeyes_sdk.tests.AgentToServerTestRequest() # AgentToServerTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create Agent to Server test + api_response = api_instance.create_agent_to_server_test(agent_to_server_test_request, aid=aid, expand=expand) + print("The response of AgentToServerTestsApi->create_agent_to_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerTestsApi->create_agent_to_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_to_server_test_request** | [**AgentToServerTestRequest**](AgentToServerTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**AgentToServerTestResponse**](AgentToServerTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_agent_to_server_test** +> delete_agent_to_server_test(test_id, aid=aid) + +Delete Agent to Server test + +Deletes an Agent to Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.AgentToServerTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete Agent to Server test + api_instance.delete_agent_to_server_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling AgentToServerTestsApi->delete_agent_to_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_agent_to_server_test** +> AgentToServerTestResponse get_agent_to_server_test(test_id, aid=aid, expand=expand) + +Get Agent to Server test + +Returns details for a Agent to Server test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.agent_to_server_test_response import AgentToServerTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.AgentToServerTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get Agent to Server test + api_response = api_instance.get_agent_to_server_test(test_id, aid=aid, expand=expand) + print("The response of AgentToServerTestsApi->get_agent_to_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerTestsApi->get_agent_to_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**AgentToServerTestResponse**](AgentToServerTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_agent_to_server_tests** +> AgentToServerTests get_agent_to_server_tests(aid=aid) + +List Agent to Server tests + +Returns a list of Agent to Server tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.agent_to_server_tests import AgentToServerTests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.AgentToServerTestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List Agent to Server tests + api_response = api_instance.get_agent_to_server_tests(aid=aid) + print("The response of AgentToServerTestsApi->get_agent_to_server_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerTestsApi->get_agent_to_server_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**AgentToServerTests**](AgentToServerTests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_agent_to_server_test** +> AgentToServerTestResponse update_agent_to_server_test(test_id, agent_to_server_test_request, aid=aid, expand=expand) + +Update Agent to Server test + +Updates an Agent to Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.agent_to_server_test_request import AgentToServerTestRequest +from thousandeyes_sdk.tests.models.agent_to_server_test_response import AgentToServerTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.AgentToServerTestsApi(api_client) + test_id = '202701' # str | Test ID + agent_to_server_test_request = thousandeyes_sdk.tests.AgentToServerTestRequest() # AgentToServerTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update Agent to Server test + api_response = api_instance.update_agent_to_server_test(test_id, agent_to_server_test_request, aid=aid, expand=expand) + print("The response of AgentToServerTestsApi->update_agent_to_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentToServerTestsApi->update_agent_to_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **agent_to_server_test_request** | [**AgentToServerTestRequest**](AgentToServerTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**AgentToServerTestResponse**](AgentToServerTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-tests/docs/ApiInstantTest.md b/thousandeyes-sdk-tests/docs/ApiInstantTest.md index 7dc2bf675..7706e45bb 100644 --- a/thousandeyes-sdk-tests/docs/ApiInstantTest.md +++ b/thousandeyes-sdk-tests/docs/ApiInstantTest.md @@ -18,10 +18,13 @@ Name | Type | Description | Notes **links** | [**TestLinks**](TestLinks.md) | | [optional] **labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] **shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] **follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] **mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] **num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] **path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] **predefined_variables** | [**List[ApiPredefinedVariable]**](ApiPredefinedVariable.md) | | [optional] **probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] @@ -31,7 +34,6 @@ Name | Type | Description | Notes **target_time** | **int** | Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior) | [optional] **time_limit** | **int** | Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error. | [optional] [default to 30] **url** | **str** | Target for the test. | -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] **credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] ## Example diff --git a/thousandeyes-sdk-tests/docs/ApiProperties.md b/thousandeyes-sdk-tests/docs/ApiProperties.md index 7b65e32a0..2f8109baf 100644 --- a/thousandeyes-sdk-tests/docs/ApiProperties.md +++ b/thousandeyes-sdk-tests/docs/ApiProperties.md @@ -5,10 +5,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] **follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] **mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] **num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] **path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] **predefined_variables** | [**List[ApiPredefinedVariable]**](ApiPredefinedVariable.md) | | [optional] **probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] diff --git a/thousandeyes-sdk-tests/docs/ApiTest.md b/thousandeyes-sdk-tests/docs/ApiTest.md index 0e4e6984e..1ccb0de05 100644 --- a/thousandeyes-sdk-tests/docs/ApiTest.md +++ b/thousandeyes-sdk-tests/docs/ApiTest.md @@ -22,10 +22,13 @@ Name | Type | Description | Notes **links** | [**TestLinks**](TestLinks.md) | | [optional] **labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] **shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] **follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] **mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] **num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] **path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] **predefined_variables** | [**List[ApiPredefinedVariable]**](ApiPredefinedVariable.md) | | [optional] **probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] @@ -35,7 +38,6 @@ Name | Type | Description | Notes **target_time** | **int** | Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior) | [optional] **time_limit** | **int** | Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error. | [optional] [default to 30] **url** | **str** | Target for the test. | -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] **credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] **bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] **use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] diff --git a/thousandeyes-sdk-tests/docs/ApiTestRequest.md b/thousandeyes-sdk-tests/docs/ApiTestRequest.md new file mode 100644 index 000000000..8881b72ac --- /dev/null +++ b/thousandeyes-sdk-tests/docs/ApiTestRequest.md @@ -0,0 +1,66 @@ +# ApiTestRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**predefined_variables** | [**List[ApiPredefinedVariable]**](ApiPredefinedVariable.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**requests** | [**List[ApiRequest]**](ApiRequest.md) | | +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**target_time** | **int** | Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior) | [optional] +**time_limit** | **int** | Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error. | [optional] [default to 30] +**url** | **str** | Target for the test. | +**credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**agents** | [**List[TestAgentRequest]**](TestAgentRequest.md) | Contains list of Agent IDs (get `agentId` from `/agents` endpoint). | + +## Example + +```python +from thousandeyes_sdk.tests.models.api_test_request import ApiTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiTestRequest from a JSON string +api_test_request_instance = ApiTestRequest.from_json(json) +# print the JSON string representation of the object +print(ApiTestRequest.to_json()) + +# convert the object into a dict +api_test_request_dict = api_test_request_instance.to_dict() +# create an instance of ApiTestRequest from a dict +api_test_request_from_dict = ApiTestRequest.from_dict(api_test_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/ApiTestResponse.md b/thousandeyes-sdk-tests/docs/ApiTestResponse.md new file mode 100644 index 000000000..04798730a --- /dev/null +++ b/thousandeyes-sdk-tests/docs/ApiTestResponse.md @@ -0,0 +1,66 @@ +# ApiTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**predefined_variables** | [**List[ApiPredefinedVariable]**](ApiPredefinedVariable.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**requests** | [**List[ApiRequest]**](ApiRequest.md) | | +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**target_time** | **int** | Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior) | [optional] +**time_limit** | **int** | Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error. | [optional] [default to 30] +**url** | **str** | Target for the test. | +**credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.tests.models.api_test_response import ApiTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiTestResponse from a JSON string +api_test_response_instance = ApiTestResponse.from_json(json) +# print the JSON string representation of the object +print(ApiTestResponse.to_json()) + +# convert the object into a dict +api_test_response_dict = api_test_response_instance.to_dict() +# create an instance of ApiTestResponse from a dict +api_test_response_from_dict = ApiTestResponse.from_dict(api_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/BGPTestsApi.md b/thousandeyes-sdk-tests/docs/BGPTestsApi.md new file mode 100644 index 000000000..427b498b4 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/BGPTestsApi.md @@ -0,0 +1,458 @@ +# thousandeyes_sdk.tests.BGPTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_bgp_test**](BGPTestsApi.md#create_bgp_test) | **POST** /tests/bgp | Create BGP test +[**delete_bgp_test**](BGPTestsApi.md#delete_bgp_test) | **DELETE** /tests/bgp/{testId} | Delete BGP test +[**get_bgp_test**](BGPTestsApi.md#get_bgp_test) | **GET** /tests/bgp/{testId} | Get BGP test +[**get_bgp_tests**](BGPTestsApi.md#get_bgp_tests) | **GET** /tests/bgp | List BGP tests +[**update_bgp_test**](BGPTestsApi.md#update_bgp_test) | **PUT** /tests/bgp/{testId} | Update BGP test + + +# **create_bgp_test** +> BgpTestResponse create_bgp_test(bgp_test_request, aid=aid, expand=expand) + +Create BGP test + +Creates a new BGP test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.bgp_test_request import BgpTestRequest +from thousandeyes_sdk.tests.models.bgp_test_response import BgpTestResponse +from thousandeyes_sdk.tests.models.expand_bgp_test_options import ExpandBgpTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.BGPTestsApi(api_client) + bgp_test_request = thousandeyes_sdk.tests.BgpTestRequest() # BgpTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandBgpTestOptions()] # List[ExpandBgpTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query. (optional) + + try: + # Create BGP test + api_response = api_instance.create_bgp_test(bgp_test_request, aid=aid, expand=expand) + print("The response of BGPTestsApi->create_bgp_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BGPTestsApi->create_bgp_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bgp_test_request** | [**BgpTestRequest**](BgpTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandBgpTestOptions]**](ExpandBgpTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query. | [optional] + +### Return type + +[**BgpTestResponse**](BgpTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_bgp_test** +> delete_bgp_test(test_id, aid=aid) + +Delete BGP test + +Deletes a BGP test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.BGPTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete BGP test + api_instance.delete_bgp_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling BGPTestsApi->delete_bgp_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_bgp_test** +> BgpTestResponse get_bgp_test(test_id, aid=aid, expand=expand) + +Get BGP test + +Returns details for a BGP test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.bgp_test_response import BgpTestResponse +from thousandeyes_sdk.tests.models.expand_bgp_test_options import ExpandBgpTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.BGPTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandBgpTestOptions()] # List[ExpandBgpTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query. (optional) + + try: + # Get BGP test + api_response = api_instance.get_bgp_test(test_id, aid=aid, expand=expand) + print("The response of BGPTestsApi->get_bgp_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BGPTestsApi->get_bgp_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandBgpTestOptions]**](ExpandBgpTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query. | [optional] + +### Return type + +[**BgpTestResponse**](BgpTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_bgp_tests** +> BgpTests get_bgp_tests(aid=aid) + +List BGP tests + +Returns a list of BGP tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.bgp_tests import BgpTests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.BGPTestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List BGP tests + api_response = api_instance.get_bgp_tests(aid=aid) + print("The response of BGPTestsApi->get_bgp_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BGPTestsApi->get_bgp_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**BgpTests**](BgpTests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_bgp_test** +> BgpTestResponse update_bgp_test(test_id, update_bgp_test_request, aid=aid, expand=expand) + +Update BGP test + +Updates a BGP test. This method requires Account Admin permissions. The target test cannot be a live share or saved event. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.bgp_test_response import BgpTestResponse +from thousandeyes_sdk.tests.models.expand_bgp_test_options import ExpandBgpTestOptions +from thousandeyes_sdk.tests.models.update_bgp_test_request import UpdateBgpTestRequest +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.BGPTestsApi(api_client) + test_id = '202701' # str | Test ID + update_bgp_test_request = thousandeyes_sdk.tests.UpdateBgpTestRequest() # UpdateBgpTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandBgpTestOptions()] # List[ExpandBgpTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query. (optional) + + try: + # Update BGP test + api_response = api_instance.update_bgp_test(test_id, update_bgp_test_request, aid=aid, expand=expand) + print("The response of BGPTestsApi->update_bgp_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BGPTestsApi->update_bgp_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **update_bgp_test_request** | [**UpdateBgpTestRequest**](UpdateBgpTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandBgpTestOptions]**](ExpandBgpTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query. | [optional] + +### Return type + +[**BgpTestResponse**](BgpTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-tests/docs/BgpTestRequest.md b/thousandeyes-sdk-tests/docs/BgpTestRequest.md new file mode 100644 index 000000000..0c0620b53 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/BgpTestRequest.md @@ -0,0 +1,48 @@ +# BgpTestRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] +**include_covered_prefixes** | **bool** | Indicate if queries for subprefixes detected under this prefix should included. | [optional] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**prefix** | **str** | a.b.c.d is a network address, with the prefix length defined as e. Prefixes can be any length from 8 to 24. | + +## Example + +```python +from thousandeyes_sdk.tests.models.bgp_test_request import BgpTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpTestRequest from a JSON string +bgp_test_request_instance = BgpTestRequest.from_json(json) +# print the JSON string representation of the object +print(BgpTestRequest.to_json()) + +# convert the object into a dict +bgp_test_request_dict = bgp_test_request_instance.to_dict() +# create an instance of BgpTestRequest from a dict +bgp_test_request_from_dict = BgpTestRequest.from_dict(bgp_test_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/BgpTestResponse.md b/thousandeyes-sdk-tests/docs/BgpTestResponse.md new file mode 100644 index 000000000..0bb2c9c15 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/BgpTestResponse.md @@ -0,0 +1,48 @@ +# BgpTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**include_covered_prefixes** | **bool** | Indicate if queries for subprefixes detected under this prefix should included. | [optional] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | A list of enabled alert rule objects. | [optional] +**prefix** | **str** | a.b.c.d is a network address, with the prefix length defined as e. Prefixes can be any length from 8 to 24. | + +## Example + +```python +from thousandeyes_sdk.tests.models.bgp_test_response import BgpTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpTestResponse from a JSON string +bgp_test_response_instance = BgpTestResponse.from_json(json) +# print the JSON string representation of the object +print(BgpTestResponse.to_json()) + +# convert the object into a dict +bgp_test_response_dict = bgp_test_response_instance.to_dict() +# create an instance of BgpTestResponse from a dict +bgp_test_response_from_dict = BgpTestResponse.from_dict(bgp_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/DNSSECTestsApi.md b/thousandeyes-sdk-tests/docs/DNSSECTestsApi.md new file mode 100644 index 000000000..b7e88ab55 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/DNSSECTestsApi.md @@ -0,0 +1,458 @@ +# thousandeyes_sdk.tests.DNSSECTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_dns_sec_test**](DNSSECTestsApi.md#create_dns_sec_test) | **POST** /tests/dnssec | Create DNSSEC test +[**delete_dns_sec_test**](DNSSECTestsApi.md#delete_dns_sec_test) | **DELETE** /tests/dnssec/{testId} | Delete DNSSEC test +[**get_dns_sec_test**](DNSSECTestsApi.md#get_dns_sec_test) | **GET** /tests/dnssec/{testId} | Get DNSSEC test +[**get_dns_sec_tests**](DNSSECTestsApi.md#get_dns_sec_tests) | **GET** /tests/dnssec | List DNSSEC tests +[**update_dns_sec_test**](DNSSECTestsApi.md#update_dns_sec_test) | **PUT** /tests/dnssec/{testId} | Update DNSSEC test + + +# **create_dns_sec_test** +> DnsSecTestResponse create_dns_sec_test(dns_sec_test_request, aid=aid, expand=expand) + +Create DNSSEC test + +Creates a new DNSSEC test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.dns_sec_test_request import DnsSecTestRequest +from thousandeyes_sdk.tests.models.dns_sec_test_response import DnsSecTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.DNSSECTestsApi(api_client) + dns_sec_test_request = thousandeyes_sdk.tests.DnsSecTestRequest() # DnsSecTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create DNSSEC test + api_response = api_instance.create_dns_sec_test(dns_sec_test_request, aid=aid, expand=expand) + print("The response of DNSSECTestsApi->create_dns_sec_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSSECTestsApi->create_dns_sec_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dns_sec_test_request** | [**DnsSecTestRequest**](DnsSecTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**DnsSecTestResponse**](DnsSecTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_dns_sec_test** +> delete_dns_sec_test(test_id, aid=aid) + +Delete DNSSEC test + +Deletes the specified DNSSEC test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.DNSSECTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete DNSSEC test + api_instance.delete_dns_sec_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling DNSSECTestsApi->delete_dns_sec_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_dns_sec_test** +> DnsSecTestResponse get_dns_sec_test(test_id, aid=aid, expand=expand) + +Get DNSSEC test + +Returns details for a DNSSEC test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.dns_sec_test_response import DnsSecTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.DNSSECTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get DNSSEC test + api_response = api_instance.get_dns_sec_test(test_id, aid=aid, expand=expand) + print("The response of DNSSECTestsApi->get_dns_sec_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSSECTestsApi->get_dns_sec_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**DnsSecTestResponse**](DnsSecTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_dns_sec_tests** +> DnsSecTests get_dns_sec_tests(aid=aid) + +List DNSSEC tests + +Returns a list of all DNSSEC tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.dns_sec_tests import DnsSecTests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.DNSSECTestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List DNSSEC tests + api_response = api_instance.get_dns_sec_tests(aid=aid) + print("The response of DNSSECTestsApi->get_dns_sec_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSSECTestsApi->get_dns_sec_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**DnsSecTests**](DnsSecTests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_dns_sec_test** +> DnsSecTestResponse update_dns_sec_test(test_id, dns_sec_test_request, aid=aid, expand=expand) + +Update DNSSEC test + +Updates a DNSSEC test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.dns_sec_test_request import DnsSecTestRequest +from thousandeyes_sdk.tests.models.dns_sec_test_response import DnsSecTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.DNSSECTestsApi(api_client) + test_id = '202701' # str | Test ID + dns_sec_test_request = thousandeyes_sdk.tests.DnsSecTestRequest() # DnsSecTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update DNSSEC test + api_response = api_instance.update_dns_sec_test(test_id, dns_sec_test_request, aid=aid, expand=expand) + print("The response of DNSSECTestsApi->update_dns_sec_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSSECTestsApi->update_dns_sec_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **dns_sec_test_request** | [**DnsSecTestRequest**](DnsSecTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**DnsSecTestResponse**](DnsSecTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-tests/docs/DNSServerTestsApi.md b/thousandeyes-sdk-tests/docs/DNSServerTestsApi.md new file mode 100644 index 000000000..ed4470a4c --- /dev/null +++ b/thousandeyes-sdk-tests/docs/DNSServerTestsApi.md @@ -0,0 +1,458 @@ +# thousandeyes_sdk.tests.DNSServerTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_dns_server_test**](DNSServerTestsApi.md#create_dns_server_test) | **POST** /tests/dns-server | Create DNS Server test +[**delete_dns_server_test**](DNSServerTestsApi.md#delete_dns_server_test) | **DELETE** /tests/dns-server/{testId} | Delete DNS Server test +[**get_dns_server_test**](DNSServerTestsApi.md#get_dns_server_test) | **GET** /tests/dns-server/{testId} | Get DNS Server test +[**get_dns_server_tests**](DNSServerTestsApi.md#get_dns_server_tests) | **GET** /tests/dns-server | List DNS Server tests +[**update_dns_server_test**](DNSServerTestsApi.md#update_dns_server_test) | **PUT** /tests/dns-server/{testId} | Update DNS Server test + + +# **create_dns_server_test** +> DnsServerTestResponse create_dns_server_test(dns_server_test_request, aid=aid, expand=expand) + +Create DNS Server test + +Creates a new DNS Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.dns_server_test_request import DnsServerTestRequest +from thousandeyes_sdk.tests.models.dns_server_test_response import DnsServerTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.DNSServerTestsApi(api_client) + dns_server_test_request = thousandeyes_sdk.tests.DnsServerTestRequest() # DnsServerTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create DNS Server test + api_response = api_instance.create_dns_server_test(dns_server_test_request, aid=aid, expand=expand) + print("The response of DNSServerTestsApi->create_dns_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSServerTestsApi->create_dns_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dns_server_test_request** | [**DnsServerTestRequest**](DnsServerTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**DnsServerTestResponse**](DnsServerTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_dns_server_test** +> delete_dns_server_test(test_id, aid=aid) + +Delete DNS Server test + +Deletes the specified DNS Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.DNSServerTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete DNS Server test + api_instance.delete_dns_server_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling DNSServerTestsApi->delete_dns_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_dns_server_test** +> DnsServerTestResponse get_dns_server_test(test_id, aid=aid, expand=expand) + +Get DNS Server test + +Returns details for a DNS Server test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.dns_server_test_response import DnsServerTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.DNSServerTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get DNS Server test + api_response = api_instance.get_dns_server_test(test_id, aid=aid, expand=expand) + print("The response of DNSServerTestsApi->get_dns_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSServerTestsApi->get_dns_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**DnsServerTestResponse**](DnsServerTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_dns_server_tests** +> DnsServerTests get_dns_server_tests(aid=aid) + +List DNS Server tests + +Returns a list of all DNS Server tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.dns_server_tests import DnsServerTests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.DNSServerTestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List DNS Server tests + api_response = api_instance.get_dns_server_tests(aid=aid) + print("The response of DNSServerTestsApi->get_dns_server_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSServerTestsApi->get_dns_server_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**DnsServerTests**](DnsServerTests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_dns_server_test** +> DnsServerTestResponse update_dns_server_test(test_id, dns_server_test_request, aid=aid, expand=expand) + +Update DNS Server test + +Updates a DNS Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.dns_server_test_request import DnsServerTestRequest +from thousandeyes_sdk.tests.models.dns_server_test_response import DnsServerTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.DNSServerTestsApi(api_client) + test_id = '202701' # str | Test ID + dns_server_test_request = thousandeyes_sdk.tests.DnsServerTestRequest() # DnsServerTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update DNS Server test + api_response = api_instance.update_dns_server_test(test_id, dns_server_test_request, aid=aid, expand=expand) + print("The response of DNSServerTestsApi->update_dns_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSServerTestsApi->update_dns_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **dns_server_test_request** | [**DnsServerTestRequest**](DnsServerTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**DnsServerTestResponse**](DnsServerTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-tests/docs/DNSTraceTestsApi.md b/thousandeyes-sdk-tests/docs/DNSTraceTestsApi.md new file mode 100644 index 000000000..9ab1af1aa --- /dev/null +++ b/thousandeyes-sdk-tests/docs/DNSTraceTestsApi.md @@ -0,0 +1,458 @@ +# thousandeyes_sdk.tests.DNSTraceTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_dns_trace_test**](DNSTraceTestsApi.md#create_dns_trace_test) | **POST** /tests/dns-trace | Create DNS Trace test +[**delete_dns_trace_test**](DNSTraceTestsApi.md#delete_dns_trace_test) | **DELETE** /tests/dns-trace/{testId} | Delete DNS Trace test +[**get_dns_trace_test**](DNSTraceTestsApi.md#get_dns_trace_test) | **GET** /tests/dns-trace/{testId} | Get DNS Trace test +[**get_dns_trace_tests**](DNSTraceTestsApi.md#get_dns_trace_tests) | **GET** /tests/dns-trace | List DNS Trace tests +[**update_dns_trace_test**](DNSTraceTestsApi.md#update_dns_trace_test) | **PUT** /tests/dns-trace/{testId} | Update DNS Trace test + + +# **create_dns_trace_test** +> DnsTraceTestResponse create_dns_trace_test(dns_trace_test_request, aid=aid, expand=expand) + +Create DNS Trace test + +Creates a new DNS Trace test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.dns_trace_test_request import DnsTraceTestRequest +from thousandeyes_sdk.tests.models.dns_trace_test_response import DnsTraceTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.DNSTraceTestsApi(api_client) + dns_trace_test_request = thousandeyes_sdk.tests.DnsTraceTestRequest() # DnsTraceTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create DNS Trace test + api_response = api_instance.create_dns_trace_test(dns_trace_test_request, aid=aid, expand=expand) + print("The response of DNSTraceTestsApi->create_dns_trace_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSTraceTestsApi->create_dns_trace_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dns_trace_test_request** | [**DnsTraceTestRequest**](DnsTraceTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**DnsTraceTestResponse**](DnsTraceTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_dns_trace_test** +> delete_dns_trace_test(test_id, aid=aid) + +Delete DNS Trace test + +Deletes the specified DNS Trace test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.DNSTraceTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete DNS Trace test + api_instance.delete_dns_trace_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling DNSTraceTestsApi->delete_dns_trace_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_dns_trace_test** +> DnsTraceTestResponse get_dns_trace_test(test_id, aid=aid, expand=expand) + +Get DNS Trace test + +Returns details for a DNS Trace test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.dns_trace_test_response import DnsTraceTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.DNSTraceTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get DNS Trace test + api_response = api_instance.get_dns_trace_test(test_id, aid=aid, expand=expand) + print("The response of DNSTraceTestsApi->get_dns_trace_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSTraceTestsApi->get_dns_trace_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**DnsTraceTestResponse**](DnsTraceTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_dns_trace_tests** +> DnsTraceTests get_dns_trace_tests(aid=aid) + +List DNS Trace tests + +Returns a list of all DNS Trace tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.dns_trace_tests import DnsTraceTests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.DNSTraceTestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List DNS Trace tests + api_response = api_instance.get_dns_trace_tests(aid=aid) + print("The response of DNSTraceTestsApi->get_dns_trace_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSTraceTestsApi->get_dns_trace_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**DnsTraceTests**](DnsTraceTests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_dns_trace_test** +> DnsTraceTestResponse update_dns_trace_test(test_id, dns_trace_test_request, aid=aid, expand=expand) + +Update DNS Trace test + +Updates a DNS Trace test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.dns_trace_test_request import DnsTraceTestRequest +from thousandeyes_sdk.tests.models.dns_trace_test_response import DnsTraceTestResponse +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.DNSTraceTestsApi(api_client) + test_id = '202701' # str | Test ID + dns_trace_test_request = thousandeyes_sdk.tests.DnsTraceTestRequest() # DnsTraceTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update DNS Trace test + api_response = api_instance.update_dns_trace_test(test_id, dns_trace_test_request, aid=aid, expand=expand) + print("The response of DNSTraceTestsApi->update_dns_trace_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DNSTraceTestsApi->update_dns_trace_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **dns_trace_test_request** | [**DnsTraceTestRequest**](DnsTraceTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**DnsTraceTestResponse**](DnsTraceTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-tests/docs/DnsSecInstantTest.md b/thousandeyes-sdk-tests/docs/DnsSecInstantTest.md index 66129df12..cfc486013 100644 --- a/thousandeyes-sdk-tests/docs/DnsSecInstantTest.md +++ b/thousandeyes-sdk-tests/docs/DnsSecInstantTest.md @@ -20,7 +20,6 @@ Name | Type | Description | Notes **shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] **domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | **dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-tests/docs/DnsSecTest.md b/thousandeyes-sdk-tests/docs/DnsSecTest.md index 17cac3f4b..d101e2fce 100644 --- a/thousandeyes-sdk-tests/docs/DnsSecTest.md +++ b/thousandeyes-sdk-tests/docs/DnsSecTest.md @@ -24,7 +24,6 @@ Name | Type | Description | Notes **shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] **domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | **dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-tests/docs/DnsSecTestRequest.md b/thousandeyes-sdk-tests/docs/DnsSecTestRequest.md new file mode 100644 index 000000000..c2fe4f516 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/DnsSecTestRequest.md @@ -0,0 +1,48 @@ +# DnsSecTestRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] +**agents** | [**List[TestAgentRequest]**](TestAgentRequest.md) | Contains list of Agent IDs (get `agentId` from `/agents` endpoint). | + +## Example + +```python +from thousandeyes_sdk.tests.models.dns_sec_test_request import DnsSecTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsSecTestRequest from a JSON string +dns_sec_test_request_instance = DnsSecTestRequest.from_json(json) +# print the JSON string representation of the object +print(DnsSecTestRequest.to_json()) + +# convert the object into a dict +dns_sec_test_request_dict = dns_sec_test_request_instance.to_dict() +# create an instance of DnsSecTestRequest from a dict +dns_sec_test_request_from_dict = DnsSecTestRequest.from_dict(dns_sec_test_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/DnsSecTestResponse.md b/thousandeyes-sdk-tests/docs/DnsSecTestResponse.md new file mode 100644 index 000000000..396b82abc --- /dev/null +++ b/thousandeyes-sdk-tests/docs/DnsSecTestResponse.md @@ -0,0 +1,48 @@ +# DnsSecTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.tests.models.dns_sec_test_response import DnsSecTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsSecTestResponse from a JSON string +dns_sec_test_response_instance = DnsSecTestResponse.from_json(json) +# print the JSON string representation of the object +print(DnsSecTestResponse.to_json()) + +# convert the object into a dict +dns_sec_test_response_dict = dns_sec_test_response_instance.to_dict() +# create an instance of DnsSecTestResponse from a dict +dns_sec_test_response_from_dict = DnsSecTestResponse.from_dict(dns_sec_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/DnsServerInstantTest.md b/thousandeyes-sdk-tests/docs/DnsServerInstantTest.md index 066b9f475..9fb57bb3e 100644 --- a/thousandeyes-sdk-tests/docs/DnsServerInstantTest.md +++ b/thousandeyes-sdk-tests/docs/DnsServerInstantTest.md @@ -32,7 +32,6 @@ Name | Type | Description | Notes **ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] **fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] **dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-tests/docs/DnsServerTest.md b/thousandeyes-sdk-tests/docs/DnsServerTest.md index 398ea641e..4488b03bc 100644 --- a/thousandeyes-sdk-tests/docs/DnsServerTest.md +++ b/thousandeyes-sdk-tests/docs/DnsServerTest.md @@ -36,7 +36,6 @@ Name | Type | Description | Notes **ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] **fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] **dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] **bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] **use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] **monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] diff --git a/thousandeyes-sdk-tests/docs/DnsServerTestRequest.md b/thousandeyes-sdk-tests/docs/DnsServerTestRequest.md new file mode 100644 index 000000000..625536c3d --- /dev/null +++ b/thousandeyes-sdk-tests/docs/DnsServerTestRequest.md @@ -0,0 +1,63 @@ +# DnsServerTestRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**dns_servers** | **List[str]** | A list of DNS server FQDN. | +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**recursive_queries** | **bool** | Set true to run query with RD (recursion desired) flag enabled. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] +**agents** | [**List[TestAgentRequest]**](TestAgentRequest.md) | Contains list of Agent IDs (get `agentId` from `/agents` endpoint). | + +## Example + +```python +from thousandeyes_sdk.tests.models.dns_server_test_request import DnsServerTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsServerTestRequest from a JSON string +dns_server_test_request_instance = DnsServerTestRequest.from_json(json) +# print the JSON string representation of the object +print(DnsServerTestRequest.to_json()) + +# convert the object into a dict +dns_server_test_request_dict = dns_server_test_request_instance.to_dict() +# create an instance of DnsServerTestRequest from a dict +dns_server_test_request_from_dict = DnsServerTestRequest.from_dict(dns_server_test_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/DnsServerTestResponse.md b/thousandeyes-sdk-tests/docs/DnsServerTestResponse.md new file mode 100644 index 000000000..3a40e5a29 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/DnsServerTestResponse.md @@ -0,0 +1,63 @@ +# DnsServerTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**dns_servers** | [**List[TestDnsServer]**](TestDnsServer.md) | | +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**recursive_queries** | **bool** | Set true to run query with RD (recursion desired) flag enabled. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.tests.models.dns_server_test_response import DnsServerTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsServerTestResponse from a JSON string +dns_server_test_response_instance = DnsServerTestResponse.from_json(json) +# print the JSON string representation of the object +print(DnsServerTestResponse.to_json()) + +# convert the object into a dict +dns_server_test_response_dict = dns_server_test_response_instance.to_dict() +# create an instance of DnsServerTestResponse from a dict +dns_server_test_response_from_dict = DnsServerTestResponse.from_dict(dns_server_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/DnsTraceInstantTest.md b/thousandeyes-sdk-tests/docs/DnsTraceInstantTest.md index 902d75842..089d02589 100644 --- a/thousandeyes-sdk-tests/docs/DnsTraceInstantTest.md +++ b/thousandeyes-sdk-tests/docs/DnsTraceInstantTest.md @@ -21,7 +21,6 @@ Name | Type | Description | Notes **dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] **domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | **dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-tests/docs/DnsTraceTest.md b/thousandeyes-sdk-tests/docs/DnsTraceTest.md index ab4c6fb9f..86787b17f 100644 --- a/thousandeyes-sdk-tests/docs/DnsTraceTest.md +++ b/thousandeyes-sdk-tests/docs/DnsTraceTest.md @@ -25,7 +25,6 @@ Name | Type | Description | Notes **dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] **domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | **dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-tests/docs/DnsTraceTestRequest.md b/thousandeyes-sdk-tests/docs/DnsTraceTestRequest.md new file mode 100644 index 000000000..0385bc7e9 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/DnsTraceTestRequest.md @@ -0,0 +1,49 @@ +# DnsTraceTestRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] +**agents** | [**List[TestAgentRequest]**](TestAgentRequest.md) | Contains list of Agent IDs (get `agentId` from `/agents` endpoint). | + +## Example + +```python +from thousandeyes_sdk.tests.models.dns_trace_test_request import DnsTraceTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsTraceTestRequest from a JSON string +dns_trace_test_request_instance = DnsTraceTestRequest.from_json(json) +# print the JSON string representation of the object +print(DnsTraceTestRequest.to_json()) + +# convert the object into a dict +dns_trace_test_request_dict = dns_trace_test_request_instance.to_dict() +# create an instance of DnsTraceTestRequest from a dict +dns_trace_test_request_from_dict = DnsTraceTestRequest.from_dict(dns_trace_test_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/DnsTraceTestResponse.md b/thousandeyes-sdk-tests/docs/DnsTraceTestResponse.md new file mode 100644 index 000000000..6b09b6417 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/DnsTraceTestResponse.md @@ -0,0 +1,49 @@ +# DnsTraceTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**dns_transport_protocol** | [**TestDnsTransportProtocol**](TestDnsTransportProtocol.md) | | [optional] +**domain** | **str** | The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. | +**dns_query_class** | [**DnsQueryClass**](DnsQueryClass.md) | | [optional] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.tests.models.dns_trace_test_response import DnsTraceTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsTraceTestResponse from a JSON string +dns_trace_test_response_instance = DnsTraceTestResponse.from_json(json) +# print the JSON string representation of the object +print(DnsTraceTestResponse.to_json()) + +# convert the object into a dict +dns_trace_test_response_dict = dns_trace_test_response_instance.to_dict() +# create an instance of DnsTraceTestResponse from a dict +dns_trace_test_response_from_dict = DnsTraceTestResponse.from_dict(dns_trace_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/ExpandBgpTestOptions.md b/thousandeyes-sdk-tests/docs/ExpandBgpTestOptions.md new file mode 100644 index 000000000..13cf2abde --- /dev/null +++ b/thousandeyes-sdk-tests/docs/ExpandBgpTestOptions.md @@ -0,0 +1,11 @@ +# ExpandBgpTestOptions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/ExpandTestOptions.md b/thousandeyes-sdk-tests/docs/ExpandTestOptions.md new file mode 100644 index 000000000..8f7c46831 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/ExpandTestOptions.md @@ -0,0 +1,11 @@ +# ExpandTestOptions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/FTPServerTestsApi.md b/thousandeyes-sdk-tests/docs/FTPServerTestsApi.md new file mode 100644 index 000000000..5376b8f0e --- /dev/null +++ b/thousandeyes-sdk-tests/docs/FTPServerTestsApi.md @@ -0,0 +1,456 @@ +# thousandeyes_sdk.tests.FTPServerTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_ftp_server_test**](FTPServerTestsApi.md#create_ftp_server_test) | **POST** /tests/ftp-server | Create FTP Server test +[**delete_ftp_server_test**](FTPServerTestsApi.md#delete_ftp_server_test) | **DELETE** /tests/ftp-server/{testId} | Delete FTP Server test +[**get_ftp_server_test**](FTPServerTestsApi.md#get_ftp_server_test) | **GET** /tests/ftp-server/{testId} | Get FTP Server test +[**get_ftp_server_tests**](FTPServerTestsApi.md#get_ftp_server_tests) | **GET** /tests/ftp-server | List FTP Server tests +[**update_ftp_server_test**](FTPServerTestsApi.md#update_ftp_server_test) | **PUT** /tests/ftp-server/{testId} | Update FTP Server test + + +# **create_ftp_server_test** +> FtpServerTestResponse create_ftp_server_test(ftp_server_test_request, aid=aid, expand=expand) + +Create FTP Server test + +Creates a new FTP Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.ftp_server_test_request import FtpServerTestRequest +from thousandeyes_sdk.tests.models.ftp_server_test_response import FtpServerTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.FTPServerTestsApi(api_client) + ftp_server_test_request = thousandeyes_sdk.tests.FtpServerTestRequest() # FtpServerTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create FTP Server test + api_response = api_instance.create_ftp_server_test(ftp_server_test_request, aid=aid, expand=expand) + print("The response of FTPServerTestsApi->create_ftp_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FTPServerTestsApi->create_ftp_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ftp_server_test_request** | [**FtpServerTestRequest**](FtpServerTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**FtpServerTestResponse**](FtpServerTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_ftp_server_test** +> delete_ftp_server_test(test_id, aid=aid) + +Delete FTP Server test + +Deletes the specified FTP Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.FTPServerTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete FTP Server test + api_instance.delete_ftp_server_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling FTPServerTestsApi->delete_ftp_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_ftp_server_test** +> FtpServerTestResponse get_ftp_server_test(test_id, aid=aid, expand=expand) + +Get FTP Server test + +Returns details for a FTP Server test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.ftp_server_test_response import FtpServerTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.FTPServerTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get FTP Server test + api_response = api_instance.get_ftp_server_test(test_id, aid=aid, expand=expand) + print("The response of FTPServerTestsApi->get_ftp_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FTPServerTestsApi->get_ftp_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**FtpServerTestResponse**](FtpServerTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_ftp_server_tests** +> FtpServerTests get_ftp_server_tests(aid=aid) + +List FTP Server tests + +Returns a list of FTP Server tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.ftp_server_tests import FtpServerTests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.FTPServerTestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List FTP Server tests + api_response = api_instance.get_ftp_server_tests(aid=aid) + print("The response of FTPServerTestsApi->get_ftp_server_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FTPServerTestsApi->get_ftp_server_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**FtpServerTests**](FtpServerTests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_ftp_server_test** +> FtpServerTestResponse update_ftp_server_test(test_id, ftp_server_test_request, aid=aid, expand=expand) + +Update FTP Server test + +Updates a FTP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.ftp_server_test_request import FtpServerTestRequest +from thousandeyes_sdk.tests.models.ftp_server_test_response import FtpServerTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.FTPServerTestsApi(api_client) + test_id = '202701' # str | Test ID + ftp_server_test_request = thousandeyes_sdk.tests.FtpServerTestRequest() # FtpServerTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update FTP Server test + api_response = api_instance.update_ftp_server_test(test_id, ftp_server_test_request, aid=aid, expand=expand) + print("The response of FTPServerTestsApi->update_ftp_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FTPServerTestsApi->update_ftp_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **ftp_server_test_request** | [**FtpServerTestRequest**](FtpServerTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**FtpServerTestResponse**](FtpServerTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-tests/docs/FtpServerInstantTest.md b/thousandeyes-sdk-tests/docs/FtpServerInstantTest.md index 26e8190ae..f2257fb35 100644 --- a/thousandeyes-sdk-tests/docs/FtpServerInstantTest.md +++ b/thousandeyes-sdk-tests/docs/FtpServerInstantTest.md @@ -36,7 +36,6 @@ Name | Type | Description | Notes **username** | **str** | Username for Basic/NTLM authentication. | **fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] **ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-tests/docs/FtpServerTest.md b/thousandeyes-sdk-tests/docs/FtpServerTest.md index a7bd2276a..b6b0e7605 100644 --- a/thousandeyes-sdk-tests/docs/FtpServerTest.md +++ b/thousandeyes-sdk-tests/docs/FtpServerTest.md @@ -40,7 +40,6 @@ Name | Type | Description | Notes **username** | **str** | Username for Basic/NTLM authentication. | **fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] **ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] **bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] **use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] **monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] diff --git a/thousandeyes-sdk-tests/docs/FtpServerTestRequest.md b/thousandeyes-sdk-tests/docs/FtpServerTestRequest.md new file mode 100644 index 000000000..537de9786 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/FtpServerTestRequest.md @@ -0,0 +1,67 @@ +# FtpServerTestRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**download_limit** | **int** | Specify maximum number of bytes to download from the target object. | [optional] +**ftp_target_time** | **int** | Target time for operation completion; specified in milliseconds. | [optional] +**ftp_time_limit** | **int** | Set the time limit for the test in seconds. | [optional] [default to 10] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**request_type** | [**FtpServerRequestType**](FtpServerRequestType.md) | | +**url** | **str** | Target for the test. | +**use_active_ftp** | **bool** | Explicitly set the flag to use active FTP. | [optional] [default to False] +**use_explicit_ftps** | **bool** | Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] +**agents** | [**List[TestAgentRequest]**](TestAgentRequest.md) | Contains list of Agent IDs (get `agentId` from `/agents` endpoint). | + +## Example + +```python +from thousandeyes_sdk.tests.models.ftp_server_test_request import FtpServerTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of FtpServerTestRequest from a JSON string +ftp_server_test_request_instance = FtpServerTestRequest.from_json(json) +# print the JSON string representation of the object +print(FtpServerTestRequest.to_json()) + +# convert the object into a dict +ftp_server_test_request_dict = ftp_server_test_request_instance.to_dict() +# create an instance of FtpServerTestRequest from a dict +ftp_server_test_request_from_dict = FtpServerTestRequest.from_dict(ftp_server_test_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/FtpServerTestResponse.md b/thousandeyes-sdk-tests/docs/FtpServerTestResponse.md new file mode 100644 index 000000000..c2d58ee59 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/FtpServerTestResponse.md @@ -0,0 +1,67 @@ +# FtpServerTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**download_limit** | **int** | Specify maximum number of bytes to download from the target object. | [optional] +**ftp_target_time** | **int** | Target time for operation completion; specified in milliseconds. | [optional] +**ftp_time_limit** | **int** | Set the time limit for the test in seconds. | [optional] [default to 10] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**password** | **str** | Password for Basic/NTLM authentication. | +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**request_type** | [**FtpServerRequestType**](FtpServerRequestType.md) | | +**url** | **str** | Target for the test. | +**use_active_ftp** | **bool** | Explicitly set the flag to use active FTP. | [optional] [default to False] +**use_explicit_ftps** | **bool** | Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.tests.models.ftp_server_test_response import FtpServerTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FtpServerTestResponse from a JSON string +ftp_server_test_response_instance = FtpServerTestResponse.from_json(json) +# print the JSON string representation of the object +print(FtpServerTestResponse.to_json()) + +# convert the object into a dict +ftp_server_test_response_dict = ftp_server_test_response_instance.to_dict() +# create an instance of FtpServerTestResponse from a dict +ftp_server_test_response_from_dict = FtpServerTestResponse.from_dict(ftp_server_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/HTTPServerTestsApi.md b/thousandeyes-sdk-tests/docs/HTTPServerTestsApi.md new file mode 100644 index 000000000..dd2865953 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/HTTPServerTestsApi.md @@ -0,0 +1,458 @@ +# thousandeyes_sdk.tests.HTTPServerTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_http_server_test**](HTTPServerTestsApi.md#create_http_server_test) | **POST** /tests/http-server | Create HTTP Server test +[**delete_http_server_test**](HTTPServerTestsApi.md#delete_http_server_test) | **DELETE** /tests/http-server/{testId} | Delete HTTP Server test +[**get_http_server_test**](HTTPServerTestsApi.md#get_http_server_test) | **GET** /tests/http-server/{testId} | Get HTTP Server test +[**get_http_server_tests**](HTTPServerTestsApi.md#get_http_server_tests) | **GET** /tests/http-server | List HTTP Server tests +[**update_http_server_test**](HTTPServerTestsApi.md#update_http_server_test) | **PUT** /tests/http-server/{testId} | Update HTTP Server test + + +# **create_http_server_test** +> HttpServerTestResponse create_http_server_test(http_server_test_request, aid=aid, expand=expand) + +Create HTTP Server test + +Creates a new HTTP Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.http_server_test_request import HttpServerTestRequest +from thousandeyes_sdk.tests.models.http_server_test_response import HttpServerTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.HTTPServerTestsApi(api_client) + http_server_test_request = thousandeyes_sdk.tests.HttpServerTestRequest() # HttpServerTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create HTTP Server test + api_response = api_instance.create_http_server_test(http_server_test_request, aid=aid, expand=expand) + print("The response of HTTPServerTestsApi->create_http_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPServerTestsApi->create_http_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **http_server_test_request** | [**HttpServerTestRequest**](HttpServerTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**HttpServerTestResponse**](HttpServerTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_http_server_test** +> delete_http_server_test(test_id, aid=aid) + +Delete HTTP Server test + +Deletes the specified HTTP Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.HTTPServerTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete HTTP Server test + api_instance.delete_http_server_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling HTTPServerTestsApi->delete_http_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_http_server_test** +> HttpServerTestResponse get_http_server_test(test_id, aid=aid, expand=expand) + +Get HTTP Server test + +Returns details for a HTTP Server test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.http_server_test_response import HttpServerTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.HTTPServerTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get HTTP Server test + api_response = api_instance.get_http_server_test(test_id, aid=aid, expand=expand) + print("The response of HTTPServerTestsApi->get_http_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPServerTestsApi->get_http_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**HttpServerTestResponse**](HttpServerTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_http_server_tests** +> HttpServerTests get_http_server_tests(aid=aid) + +List HTTP Server tests + +Returns a list of all HTTP Server tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.http_server_tests import HttpServerTests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.HTTPServerTestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List HTTP Server tests + api_response = api_instance.get_http_server_tests(aid=aid) + print("The response of HTTPServerTestsApi->get_http_server_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPServerTestsApi->get_http_server_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**HttpServerTests**](HttpServerTests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_http_server_test** +> HttpServerTestResponse update_http_server_test(test_id, http_server_test_request, aid=aid, expand=expand) + +Update HTTP Server test + +Updates a HTTP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.http_server_test_request import HttpServerTestRequest +from thousandeyes_sdk.tests.models.http_server_test_response import HttpServerTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.HTTPServerTestsApi(api_client) + test_id = '202701' # str | Test ID + http_server_test_request = thousandeyes_sdk.tests.HttpServerTestRequest() # HttpServerTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update HTTP Server test + api_response = api_instance.update_http_server_test(test_id, http_server_test_request, aid=aid, expand=expand) + print("The response of HTTPServerTestsApi->update_http_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HTTPServerTestsApi->update_http_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **http_server_test_request** | [**HttpServerTestRequest**](HttpServerTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**HttpServerTestResponse**](HttpServerTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-tests/docs/HttpServerBaseProperties.md b/thousandeyes-sdk-tests/docs/HttpServerBaseProperties.md index 94ba5296f..b00280f1c 100644 --- a/thousandeyes-sdk-tests/docs/HttpServerBaseProperties.md +++ b/thousandeyes-sdk-tests/docs/HttpServerBaseProperties.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] diff --git a/thousandeyes-sdk-tests/docs/HttpServerInstantTest.md b/thousandeyes-sdk-tests/docs/HttpServerInstantTest.md index 0a7335c00..a9bb08484 100644 --- a/thousandeyes-sdk-tests/docs/HttpServerInstantTest.md +++ b/thousandeyes-sdk-tests/docs/HttpServerInstantTest.md @@ -24,7 +24,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] @@ -55,7 +55,6 @@ Name | Type | Description | Notes **headers** | **List[str]** | HTTP request headers used. | [optional] **post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] **ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-tests/docs/HttpServerProperties.md b/thousandeyes-sdk-tests/docs/HttpServerProperties.md index 666b238be..670aa5a7b 100644 --- a/thousandeyes-sdk-tests/docs/HttpServerProperties.md +++ b/thousandeyes-sdk-tests/docs/HttpServerProperties.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] diff --git a/thousandeyes-sdk-tests/docs/HttpServerTest.md b/thousandeyes-sdk-tests/docs/HttpServerTest.md index efcfaab72..20e3d7948 100644 --- a/thousandeyes-sdk-tests/docs/HttpServerTest.md +++ b/thousandeyes-sdk-tests/docs/HttpServerTest.md @@ -28,7 +28,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] @@ -59,7 +59,6 @@ Name | Type | Description | Notes **headers** | **List[str]** | HTTP request headers used. | [optional] **post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] **ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] **bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] **use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] **monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] diff --git a/thousandeyes-sdk-tests/docs/HttpServerTestRequest.md b/thousandeyes-sdk-tests/docs/HttpServerTestRequest.md new file mode 100644 index 000000000..1222c4ac6 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/HttpServerTestRequest.md @@ -0,0 +1,86 @@ +# HttpServerTestRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**agent_interfaces** | [**AgentInterfaces**](AgentInterfaces.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] +**download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] +**dns_override** | **str** | IP address to use for DNS override. | [optional] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**o_auth** | [**OAuth**](OAuth.md) | | [optional] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**allow_unsafe_legacy_renegotiation** | **bool** | Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation. | [optional] [default to True] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] +**headers** | **List[str]** | HTTP request headers used. | [optional] +**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] +**agents** | [**List[TestAgentRequest]**](TestAgentRequest.md) | Contains list of Agent IDs (get `agentId` from `/agents` endpoint). | + +## Example + +```python +from thousandeyes_sdk.tests.models.http_server_test_request import HttpServerTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpServerTestRequest from a JSON string +http_server_test_request_instance = HttpServerTestRequest.from_json(json) +# print the JSON string representation of the object +print(HttpServerTestRequest.to_json()) + +# convert the object into a dict +http_server_test_request_dict = http_server_test_request_instance.to_dict() +# create an instance of HttpServerTestRequest from a dict +http_server_test_request_from_dict = HttpServerTestRequest.from_dict(http_server_test_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/HttpServerTestResponse.md b/thousandeyes-sdk-tests/docs/HttpServerTestResponse.md new file mode 100644 index 000000000..5447458ed --- /dev/null +++ b/thousandeyes-sdk-tests/docs/HttpServerTestResponse.md @@ -0,0 +1,86 @@ +# HttpServerTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**agent_interfaces** | [**AgentInterfaces**](AgentInterfaces.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] +**download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] +**dns_override** | **str** | IP address to use for DNS override. | [optional] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**o_auth** | [**OAuth**](OAuth.md) | | [optional] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**allow_unsafe_legacy_renegotiation** | **bool** | Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation. | [optional] [default to True] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] +**headers** | **List[str]** | HTTP request headers used. | [optional] +**post_body** | **str** | Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.tests.models.http_server_test_response import HttpServerTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of HttpServerTestResponse from a JSON string +http_server_test_response_instance = HttpServerTestResponse.from_json(json) +# print the JSON string representation of the object +print(HttpServerTestResponse.to_json()) + +# convert the object into a dict +http_server_test_response_dict = http_server_test_response_instance.to_dict() +# create an instance of HttpServerTestResponse from a dict +http_server_test_response_from_dict = HttpServerTestResponse.from_dict(http_server_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/PageLoadInstantTest.md b/thousandeyes-sdk-tests/docs/PageLoadInstantTest.md index 87fd71d1d..c5ac0227a 100644 --- a/thousandeyes-sdk-tests/docs/PageLoadInstantTest.md +++ b/thousandeyes-sdk-tests/docs/PageLoadInstantTest.md @@ -24,7 +24,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] @@ -61,7 +61,6 @@ Name | Type | Description | Notes **allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] **browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] **page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-tests/docs/PageLoadProperties.md b/thousandeyes-sdk-tests/docs/PageLoadProperties.md index 5b4283290..d546b8ef7 100644 --- a/thousandeyes-sdk-tests/docs/PageLoadProperties.md +++ b/thousandeyes-sdk-tests/docs/PageLoadProperties.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] diff --git a/thousandeyes-sdk-tests/docs/PageLoadTest.md b/thousandeyes-sdk-tests/docs/PageLoadTest.md index d6da547bc..e816b173a 100644 --- a/thousandeyes-sdk-tests/docs/PageLoadTest.md +++ b/thousandeyes-sdk-tests/docs/PageLoadTest.md @@ -28,7 +28,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] @@ -65,7 +65,6 @@ Name | Type | Description | Notes **allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] **browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] **page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] **bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] **use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] **monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] diff --git a/thousandeyes-sdk-tests/docs/PageLoadTestRequest.md b/thousandeyes-sdk-tests/docs/PageLoadTestRequest.md new file mode 100644 index 000000000..cb6643a6c --- /dev/null +++ b/thousandeyes-sdk-tests/docs/PageLoadTestRequest.md @@ -0,0 +1,94 @@ +# PageLoadTestRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**agent_interfaces** | [**AgentInterfaces**](AgentInterfaces.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] +**download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] +**dns_override** | **str** | IP address to use for DNS override. | [optional] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**o_auth** | [**OAuth**](OAuth.md) | | [optional] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**allow_unsafe_legacy_renegotiation** | **bool** | Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation. | [optional] [default to True] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] +**emulated_device_id** | **str** | ID of the emulated device, if one was given when the test was created. | [optional] +**page_load_target_time** | **int** | Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`. | [optional] +**page_load_time_limit** | **int** | Page load time limit. Must be larger than the `httpTimeLimit`. | [optional] [default to 10] +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] +**http_interval** | [**TestHttpInterval**](TestHttpInterval.md) | | [optional] +**subinterval** | [**TestSubInterval**](TestSubInterval.md) | | [optional] +**agents** | [**List[TestAgentRequest]**](TestAgentRequest.md) | Contains list of Agent IDs (get `agentId` from `/agents` endpoint). | + +## Example + +```python +from thousandeyes_sdk.tests.models.page_load_test_request import PageLoadTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of PageLoadTestRequest from a JSON string +page_load_test_request_instance = PageLoadTestRequest.from_json(json) +# print the JSON string representation of the object +print(PageLoadTestRequest.to_json()) + +# convert the object into a dict +page_load_test_request_dict = page_load_test_request_instance.to_dict() +# create an instance of PageLoadTestRequest from a dict +page_load_test_request_from_dict = PageLoadTestRequest.from_dict(page_load_test_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/PageLoadTestResponse.md b/thousandeyes-sdk-tests/docs/PageLoadTestResponse.md new file mode 100644 index 000000000..894335731 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/PageLoadTestResponse.md @@ -0,0 +1,94 @@ +# PageLoadTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**agent_interfaces** | [**AgentInterfaces**](AgentInterfaces.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] +**download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] +**dns_override** | **str** | IP address to use for DNS override. | [optional] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**o_auth** | [**OAuth**](OAuth.md) | | [optional] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**allow_unsafe_legacy_renegotiation** | **bool** | Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation. | [optional] [default to True] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] +**emulated_device_id** | **str** | ID of the emulated device, if one was given when the test was created. | [optional] +**page_load_target_time** | **int** | Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`. | [optional] +**page_load_time_limit** | **int** | Page load time limit. Must be larger than the `httpTimeLimit`. | [optional] [default to 10] +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**http_interval** | [**TestHttpInterval**](TestHttpInterval.md) | | [optional] +**subinterval** | [**TestSubInterval**](TestSubInterval.md) | | [optional] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.tests.models.page_load_test_response import PageLoadTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of PageLoadTestResponse from a JSON string +page_load_test_response_instance = PageLoadTestResponse.from_json(json) +# print the JSON string representation of the object +print(PageLoadTestResponse.to_json()) + +# convert the object into a dict +page_load_test_response_dict = page_load_test_response_instance.to_dict() +# create an instance of PageLoadTestResponse from a dict +page_load_test_response_from_dict = PageLoadTestResponse.from_dict(page_load_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/PageLoadTestsApi.md b/thousandeyes-sdk-tests/docs/PageLoadTestsApi.md new file mode 100644 index 000000000..c205932be --- /dev/null +++ b/thousandeyes-sdk-tests/docs/PageLoadTestsApi.md @@ -0,0 +1,458 @@ +# thousandeyes_sdk.tests.PageLoadTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_page_load_test**](PageLoadTestsApi.md#create_page_load_test) | **POST** /tests/page-load | Create Page Load test +[**delete_page_load_test**](PageLoadTestsApi.md#delete_page_load_test) | **DELETE** /tests/page-load/{testId} | Delete Page Load test +[**get_page_load_test**](PageLoadTestsApi.md#get_page_load_test) | **GET** /tests/page-load/{testId} | Get Page Load test +[**get_page_load_tests**](PageLoadTestsApi.md#get_page_load_tests) | **GET** /tests/page-load | List Page Load tests +[**update_page_load_test**](PageLoadTestsApi.md#update_page_load_test) | **PUT** /tests/page-load/{testId} | Update Page Load test + + +# **create_page_load_test** +> PageLoadTestResponse create_page_load_test(page_load_test_request, aid=aid, expand=expand) + +Create Page Load test + +Creates a new Page Load test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.page_load_test_request import PageLoadTestRequest +from thousandeyes_sdk.tests.models.page_load_test_response import PageLoadTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.PageLoadTestsApi(api_client) + page_load_test_request = thousandeyes_sdk.tests.PageLoadTestRequest() # PageLoadTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create Page Load test + api_response = api_instance.create_page_load_test(page_load_test_request, aid=aid, expand=expand) + print("The response of PageLoadTestsApi->create_page_load_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PageLoadTestsApi->create_page_load_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page_load_test_request** | [**PageLoadTestRequest**](PageLoadTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**PageLoadTestResponse**](PageLoadTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_page_load_test** +> delete_page_load_test(test_id, aid=aid) + +Delete Page Load test + +Deletes the specified Page Load test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.PageLoadTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete Page Load test + api_instance.delete_page_load_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling PageLoadTestsApi->delete_page_load_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_page_load_test** +> PageLoadTestResponse get_page_load_test(test_id, aid=aid, expand=expand) + +Get Page Load test + +Returns details for a Page Load test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.page_load_test_response import PageLoadTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.PageLoadTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get Page Load test + api_response = api_instance.get_page_load_test(test_id, aid=aid, expand=expand) + print("The response of PageLoadTestsApi->get_page_load_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PageLoadTestsApi->get_page_load_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**PageLoadTestResponse**](PageLoadTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_page_load_tests** +> PageLoadTests get_page_load_tests(aid=aid) + +List Page Load tests + +Returns a list of all Page Load tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.page_load_tests import PageLoadTests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.PageLoadTestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List Page Load tests + api_response = api_instance.get_page_load_tests(aid=aid) + print("The response of PageLoadTestsApi->get_page_load_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PageLoadTestsApi->get_page_load_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**PageLoadTests**](PageLoadTests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_page_load_test** +> PageLoadTestResponse update_page_load_test(test_id, page_load_test_request, aid=aid, expand=expand) + +Update Page Load test + +Updates a Page Load test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.page_load_test_request import PageLoadTestRequest +from thousandeyes_sdk.tests.models.page_load_test_response import PageLoadTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.PageLoadTestsApi(api_client) + test_id = '202701' # str | Test ID + page_load_test_request = thousandeyes_sdk.tests.PageLoadTestRequest() # PageLoadTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update Page Load test + api_response = api_instance.update_page_load_test(test_id, page_load_test_request, aid=aid, expand=expand) + print("The response of PageLoadTestsApi->update_page_load_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PageLoadTestsApi->update_page_load_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **page_load_test_request** | [**PageLoadTestRequest**](PageLoadTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**PageLoadTestResponse**](PageLoadTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-tests/docs/SIPServerTestsApi.md b/thousandeyes-sdk-tests/docs/SIPServerTestsApi.md new file mode 100644 index 000000000..6f3b4daca --- /dev/null +++ b/thousandeyes-sdk-tests/docs/SIPServerTestsApi.md @@ -0,0 +1,456 @@ +# thousandeyes_sdk.tests.SIPServerTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_sip_server_test**](SIPServerTestsApi.md#create_sip_server_test) | **POST** /tests/sip-server | Create SIP Server test +[**delete_sip_server_test**](SIPServerTestsApi.md#delete_sip_server_test) | **DELETE** /tests/sip-server/{testId} | Delete SIP Server test +[**get_sip_server_test**](SIPServerTestsApi.md#get_sip_server_test) | **GET** /tests/sip-server/{testId} | Get SIP Server test +[**get_sip_server_tests**](SIPServerTestsApi.md#get_sip_server_tests) | **GET** /tests/sip-server | List SIP Server tests +[**update_sip_server_test**](SIPServerTestsApi.md#update_sip_server_test) | **PUT** /tests/sip-server/{testId} | Update SIP Server test + + +# **create_sip_server_test** +> SipServerTestResponse create_sip_server_test(sip_server_test_request, aid=aid, expand=expand) + +Create SIP Server test + +Creates a new SIP Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.sip_server_test_request import SipServerTestRequest +from thousandeyes_sdk.tests.models.sip_server_test_response import SipServerTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.SIPServerTestsApi(api_client) + sip_server_test_request = thousandeyes_sdk.tests.SipServerTestRequest() # SipServerTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create SIP Server test + api_response = api_instance.create_sip_server_test(sip_server_test_request, aid=aid, expand=expand) + print("The response of SIPServerTestsApi->create_sip_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SIPServerTestsApi->create_sip_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sip_server_test_request** | [**SipServerTestRequest**](SipServerTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**SipServerTestResponse**](SipServerTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_sip_server_test** +> delete_sip_server_test(test_id, aid=aid) + +Delete SIP Server test + +Deletes the specified SIP Server test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.SIPServerTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete SIP Server test + api_instance.delete_sip_server_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling SIPServerTestsApi->delete_sip_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_sip_server_test** +> SipServerTestResponse get_sip_server_test(test_id, aid=aid, expand=expand) + +Get SIP Server test + +Returns details for a SIP Server test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.sip_server_test_response import SipServerTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.SIPServerTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get SIP Server test + api_response = api_instance.get_sip_server_test(test_id, aid=aid, expand=expand) + print("The response of SIPServerTestsApi->get_sip_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SIPServerTestsApi->get_sip_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**SipServerTestResponse**](SipServerTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_sip_server_tests** +> SipServerTests get_sip_server_tests(aid=aid) + +List SIP Server tests + +Returns a list of SIP Server tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.sip_server_tests import SipServerTests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.SIPServerTestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List SIP Server tests + api_response = api_instance.get_sip_server_tests(aid=aid) + print("The response of SIPServerTestsApi->get_sip_server_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SIPServerTestsApi->get_sip_server_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**SipServerTests**](SipServerTests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_sip_server_test** +> SipServerTestResponse update_sip_server_test(test_id, sip_server_test_request, aid=aid, expand=expand) + +Update SIP Server test + +Updates a SIP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.sip_server_test_request import SipServerTestRequest +from thousandeyes_sdk.tests.models.sip_server_test_response import SipServerTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.SIPServerTestsApi(api_client) + test_id = '202701' # str | Test ID + sip_server_test_request = thousandeyes_sdk.tests.SipServerTestRequest() # SipServerTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update SIP Server test + api_response = api_instance.update_sip_server_test(test_id, sip_server_test_request, aid=aid, expand=expand) + print("The response of SIPServerTestsApi->update_sip_server_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SIPServerTestsApi->update_sip_server_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **sip_server_test_request** | [**SipServerTestRequest**](SipServerTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**SipServerTestResponse**](SipServerTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-tests/docs/SipServerInstantTest.md b/thousandeyes-sdk-tests/docs/SipServerInstantTest.md index fe4888935..ffbd74a73 100644 --- a/thousandeyes-sdk-tests/docs/SipServerInstantTest.md +++ b/thousandeyes-sdk-tests/docs/SipServerInstantTest.md @@ -29,7 +29,6 @@ Name | Type | Description | Notes **sip_time_limit** | **int** | Time limit in milliseconds. | [optional] [default to 5] **fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] **ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-tests/docs/SipServerTest.md b/thousandeyes-sdk-tests/docs/SipServerTest.md index 85b789ac8..3e84dc9f7 100644 --- a/thousandeyes-sdk-tests/docs/SipServerTest.md +++ b/thousandeyes-sdk-tests/docs/SipServerTest.md @@ -9,6 +9,9 @@ Name | Type | Description | Notes **alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] **enabled** | **bool** | Test is enabled. | [optional] [default to True] **alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] **created_by** | **str** | User that created the test. | [optional] [readonly] **created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] **description** | **str** | A description of the test. | [optional] @@ -33,16 +36,12 @@ Name | Type | Description | Notes **sip_time_limit** | **int** | Time limit in milliseconds. | [optional] [default to 5] **fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] **ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] **auth_user** | **str** | Username for authentication with SIP server. | [optional] **password** | **str** | Password for Basic/NTLM authentication. | [optional] **port** | **int** | Target port. | [default to 49153] **protocol** | [**SipTestProtocol**](SipTestProtocol.md) | | [optional] **sip_registrar** | **str** | SIP server to be tested, specified by domain name or IP address. | [optional] **user** | **str** | Username for SIP registration, should be unique within a ThousandEyes account group. | [optional] -**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] -**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] -**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-tests/docs/SipServerTestRequest.md b/thousandeyes-sdk-tests/docs/SipServerTestRequest.md new file mode 100644 index 000000000..44a78e306 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/SipServerTestRequest.md @@ -0,0 +1,61 @@ +# SipServerTestRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**options_regex** | **str** | Options regex, this field does not require escaping. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**register_enabled** | **bool** | Set to true to perform SIP registration on the test target with the SIP REGISTER command. | [optional] [default to False] +**sip_target_time** | **int** | Target time for test completion in milliseconds. | [optional] +**sip_time_limit** | **int** | Time limit in milliseconds. | [optional] [default to 5] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**target_sip_credentials** | [**TestSipCredentials**](TestSipCredentials.md) | | +**agents** | [**List[TestAgentRequest]**](TestAgentRequest.md) | Contains list of Agent IDs (get `agentId` from `/agents` endpoint). | + +## Example + +```python +from thousandeyes_sdk.tests.models.sip_server_test_request import SipServerTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of SipServerTestRequest from a JSON string +sip_server_test_request_instance = SipServerTestRequest.from_json(json) +# print the JSON string representation of the object +print(SipServerTestRequest.to_json()) + +# convert the object into a dict +sip_server_test_request_dict = sip_server_test_request_instance.to_dict() +# create an instance of SipServerTestRequest from a dict +sip_server_test_request_from_dict = SipServerTestRequest.from_dict(sip_server_test_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/SipServerTestResponse.md b/thousandeyes-sdk-tests/docs/SipServerTestResponse.md new file mode 100644 index 000000000..254afa428 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/SipServerTestResponse.md @@ -0,0 +1,66 @@ +# SipServerTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**options_regex** | **str** | Options regex, this field does not require escaping. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**register_enabled** | **bool** | Set to true to perform SIP registration on the test target with the SIP REGISTER command. | [optional] [default to False] +**sip_target_time** | **int** | Target time for test completion in milliseconds. | [optional] +**sip_time_limit** | **int** | Time limit in milliseconds. | [optional] [default to 5] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] +**auth_user** | **str** | Username for authentication with SIP server. | [optional] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**port** | **int** | Target port. | [default to 49153] +**protocol** | [**SipTestProtocol**](SipTestProtocol.md) | | [optional] +**sip_registrar** | **str** | SIP server to be tested, specified by domain name or IP address. | [optional] +**user** | **str** | Username for SIP registration, should be unique within a ThousandEyes account group. | [optional] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.tests.models.sip_server_test_response import SipServerTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of SipServerTestResponse from a JSON string +sip_server_test_response_instance = SipServerTestResponse.from_json(json) +# print the JSON string representation of the object +print(SipServerTestResponse.to_json()) + +# convert the object into a dict +sip_server_test_response_dict = sip_server_test_response_instance.to_dict() +# create an instance of SipServerTestResponse from a dict +sip_server_test_response_from_dict = SipServerTestResponse.from_dict(sip_server_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/TestAgentRequest.md b/thousandeyes-sdk-tests/docs/TestAgentRequest.md new file mode 100644 index 000000000..c9f160021 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/TestAgentRequest.md @@ -0,0 +1,30 @@ +# TestAgentRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | The agent ID. Get `agentId` from `/agents` endpoint. | +**source_ip_address** | **str** | The IP address from the `ipAddresses` field in agent details, used for interface selection. Get `ipAddresses` from the `/agents` endpoint. | [optional] + +## Example + +```python +from thousandeyes_sdk.tests.models.test_agent_request import TestAgentRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of TestAgentRequest from a JSON string +test_agent_request_instance = TestAgentRequest.from_json(json) +# print the JSON string representation of the object +print(TestAgentRequest.to_json()) + +# convert the object into a dict +test_agent_request_dict = test_agent_request_instance.to_dict() +# create an instance of TestAgentRequest from a dict +test_agent_request_from_dict = TestAgentRequest.from_dict(test_agent_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/TestRequest.md b/thousandeyes-sdk-tests/docs/TestRequest.md index be81ab0b7..008d8df5e 100644 --- a/thousandeyes-sdk-tests/docs/TestRequest.md +++ b/thousandeyes-sdk-tests/docs/TestRequest.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] **shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] **alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] -**agents** | [**List[AgentRequest]**](AgentRequest.md) | | [optional] +**agents** | [**List[TestAgentRequest]**](TestAgentRequest.md) | Contains list of Agent IDs (get `agentId` from `/agents` endpoint). | ## Example diff --git a/thousandeyes-sdk-tests/docs/TestsApi.md b/thousandeyes-sdk-tests/docs/TestsApi.md new file mode 100644 index 000000000..e1dabac8c --- /dev/null +++ b/thousandeyes-sdk-tests/docs/TestsApi.md @@ -0,0 +1,94 @@ +# thousandeyes_sdk.tests.TestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_tests**](TestsApi.md#get_tests) | **GET** /tests | List configured tests + + +# **get_tests** +> Tests get_tests(aid=aid) + +List configured tests + +Returns configured tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.tests import Tests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.TestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List configured tests + api_response = api_instance.get_tests(aid=aid) + print("The response of TestsApi->get_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TestsApi->get_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**Tests**](Tests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-tests/docs/UnexpandedApiTest.md b/thousandeyes-sdk-tests/docs/UnexpandedApiTest.md index fffffba90..6d6be2e76 100644 --- a/thousandeyes-sdk-tests/docs/UnexpandedApiTest.md +++ b/thousandeyes-sdk-tests/docs/UnexpandedApiTest.md @@ -19,10 +19,13 @@ Name | Type | Description | Notes **test_name** | **str** | The name of the test. Test name must be unique. | [optional] **type** | **str** | | [optional] [readonly] **links** | [**TestLinks**](TestLinks.md) | | [optional] +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] **follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] **mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] **num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] **path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] **predefined_variables** | [**List[ApiPredefinedVariable]**](ApiPredefinedVariable.md) | | [optional] **probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] diff --git a/thousandeyes-sdk-tests/docs/UnexpandedHttpServerTest.md b/thousandeyes-sdk-tests/docs/UnexpandedHttpServerTest.md index 87db7a2a6..9974b9349 100644 --- a/thousandeyes-sdk-tests/docs/UnexpandedHttpServerTest.md +++ b/thousandeyes-sdk-tests/docs/UnexpandedHttpServerTest.md @@ -25,7 +25,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] diff --git a/thousandeyes-sdk-tests/docs/UnexpandedPageLoadTest.md b/thousandeyes-sdk-tests/docs/UnexpandedPageLoadTest.md index c6e0458ca..c57b96518 100644 --- a/thousandeyes-sdk-tests/docs/UnexpandedPageLoadTest.md +++ b/thousandeyes-sdk-tests/docs/UnexpandedPageLoadTest.md @@ -25,7 +25,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] diff --git a/thousandeyes-sdk-tests/docs/UnexpandedWebTransactionTest.md b/thousandeyes-sdk-tests/docs/UnexpandedWebTransactionTest.md index 683d24403..e84d73b2b 100644 --- a/thousandeyes-sdk-tests/docs/UnexpandedWebTransactionTest.md +++ b/thousandeyes-sdk-tests/docs/UnexpandedWebTransactionTest.md @@ -25,7 +25,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] diff --git a/thousandeyes-sdk-tests/docs/UpdateSipServerTest.md b/thousandeyes-sdk-tests/docs/UpdateSipServerTest.md index c4ba32ea2..1d150e126 100644 --- a/thousandeyes-sdk-tests/docs/UpdateSipServerTest.md +++ b/thousandeyes-sdk-tests/docs/UpdateSipServerTest.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **interval** | [**TestInterval**](TestInterval.md) | | **alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] **enabled** | **bool** | Test is enabled. | [optional] [default to True] -**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] **created_by** | **str** | User that created the test. | [optional] [readonly] **created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] **description** | **str** | A description of the test. | [optional] @@ -20,8 +20,8 @@ Name | Type | Description | Notes **test_name** | **str** | The name of the test. Test name must be unique. | [optional] **type** | **str** | | [optional] [readonly] **links** | [**TestLinks**](TestLinks.md) | | [optional] -**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] -**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] **mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] **network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] **num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] @@ -33,11 +33,10 @@ Name | Type | Description | Notes **sip_time_limit** | **int** | Time limit in milliseconds. | [optional] [default to 5] **fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] **ipv6_policy** | [**TestIpv6Policy**](TestIpv6Policy.md) | | [optional] -**agents** | [**List[AgentRequest]**](AgentRequest.md) | | [optional] -**target_sip_credentials** | [**TestSipCredentials**](TestSipCredentials.md) | | **bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] **use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] **monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**target_sip_credentials** | [**TestSipCredentials**](TestSipCredentials.md) | | ## Example diff --git a/thousandeyes-sdk-tests/docs/VoiceInstantTest.md b/thousandeyes-sdk-tests/docs/VoiceInstantTest.md index dd6ed7d5d..5c035c332 100644 --- a/thousandeyes-sdk-tests/docs/VoiceInstantTest.md +++ b/thousandeyes-sdk-tests/docs/VoiceInstantTest.md @@ -27,7 +27,6 @@ Name | Type | Description | Notes **num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] **port** | **int** | Port number for the chosen protocol. | [optional] **target_agent_id** | **str** | Agent ID of the target agent for the test. | -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-tests/docs/VoiceTest.md b/thousandeyes-sdk-tests/docs/VoiceTest.md index 884ffaee5..b2d6e2369 100644 --- a/thousandeyes-sdk-tests/docs/VoiceTest.md +++ b/thousandeyes-sdk-tests/docs/VoiceTest.md @@ -31,7 +31,6 @@ Name | Type | Description | Notes **num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] **port** | **int** | Port number for the chosen protocol. | [optional] **target_agent_id** | **str** | Agent ID of the target agent for the test. | -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] **bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] **use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] **monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] diff --git a/thousandeyes-sdk-tests/docs/VoiceTestRequest.md b/thousandeyes-sdk-tests/docs/VoiceTestRequest.md new file mode 100644 index 000000000..21347fc91 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/VoiceTestRequest.md @@ -0,0 +1,58 @@ +# VoiceTestRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**codec** | **str** | Codec label | [optional] [readonly] +**codec_id** | **str** | Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab) | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**duration** | **int** | Duration of the test in seconds. | [optional] [default to 5] +**jitter_buffer** | **int** | De-jitter buffer size in seconds. | [optional] [default to 40] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**port** | **int** | Port number for the chosen protocol. | [optional] +**target_agent_id** | **str** | Agent ID of the target agent for the test. | +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**agents** | [**List[TestAgentRequest]**](TestAgentRequest.md) | Contains list of Agent IDs (get `agentId` from `/agents` endpoint). | + +## Example + +```python +from thousandeyes_sdk.tests.models.voice_test_request import VoiceTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of VoiceTestRequest from a JSON string +voice_test_request_instance = VoiceTestRequest.from_json(json) +# print the JSON string representation of the object +print(VoiceTestRequest.to_json()) + +# convert the object into a dict +voice_test_request_dict = voice_test_request_instance.to_dict() +# create an instance of VoiceTestRequest from a dict +voice_test_request_from_dict = VoiceTestRequest.from_dict(voice_test_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/VoiceTestResponse.md b/thousandeyes-sdk-tests/docs/VoiceTestResponse.md new file mode 100644 index 000000000..923c8c586 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/VoiceTestResponse.md @@ -0,0 +1,58 @@ +# VoiceTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**codec** | **str** | Codec label | [optional] [readonly] +**codec_id** | **str** | Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab) | [optional] +**dscp** | **str** | DSCP label. | [optional] [readonly] +**dscp_id** | [**TestDscpId**](TestDscpId.md) | | [optional] +**duration** | **int** | Duration of the test in seconds. | [optional] [default to 5] +**jitter_buffer** | **int** | De-jitter buffer size in seconds. | [optional] [default to 40] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**port** | **int** | Port number for the chosen protocol. | [optional] +**target_agent_id** | **str** | Agent ID of the target agent for the test. | +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.tests.models.voice_test_response import VoiceTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of VoiceTestResponse from a JSON string +voice_test_response_instance = VoiceTestResponse.from_json(json) +# print the JSON string representation of the object +print(VoiceTestResponse.to_json()) + +# convert the object into a dict +voice_test_response_dict = voice_test_response_instance.to_dict() +# create an instance of VoiceTestResponse from a dict +voice_test_response_from_dict = VoiceTestResponse.from_dict(voice_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/VoiceTestsApi.md b/thousandeyes-sdk-tests/docs/VoiceTestsApi.md new file mode 100644 index 000000000..61c8b2aef --- /dev/null +++ b/thousandeyes-sdk-tests/docs/VoiceTestsApi.md @@ -0,0 +1,458 @@ +# thousandeyes_sdk.tests.VoiceTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_voice_test**](VoiceTestsApi.md#create_voice_test) | **POST** /tests/voice | Create Voice test +[**delete_voice_test**](VoiceTestsApi.md#delete_voice_test) | **DELETE** /tests/voice/{testId} | Delete Voice test +[**get_voice_test**](VoiceTestsApi.md#get_voice_test) | **GET** /tests/voice/{testId} | Get Voice test +[**get_voice_tests**](VoiceTestsApi.md#get_voice_tests) | **GET** /tests/voice | List Voice tests +[**update_voice_test**](VoiceTestsApi.md#update_voice_test) | **PUT** /tests/voice/{testId} | Update Voice test + + +# **create_voice_test** +> VoiceTestResponse create_voice_test(voice_test_request, aid=aid, expand=expand) + +Create Voice test + +Creates a new Voice test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.voice_test_request import VoiceTestRequest +from thousandeyes_sdk.tests.models.voice_test_response import VoiceTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.VoiceTestsApi(api_client) + voice_test_request = thousandeyes_sdk.tests.VoiceTestRequest() # VoiceTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create Voice test + api_response = api_instance.create_voice_test(voice_test_request, aid=aid, expand=expand) + print("The response of VoiceTestsApi->create_voice_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VoiceTestsApi->create_voice_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **voice_test_request** | [**VoiceTestRequest**](VoiceTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**VoiceTestResponse**](VoiceTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_voice_test** +> delete_voice_test(test_id, aid=aid) + +Delete Voice test + +Deletes the specified Voice test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.VoiceTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete Voice test + api_instance.delete_voice_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling VoiceTestsApi->delete_voice_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_voice_test** +> VoiceTestResponse get_voice_test(test_id, aid=aid, expand=expand) + +Get Voice test + +Returns details for a Voice test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.voice_test_response import VoiceTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.VoiceTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get Voice test + api_response = api_instance.get_voice_test(test_id, aid=aid, expand=expand) + print("The response of VoiceTestsApi->get_voice_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VoiceTestsApi->get_voice_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**VoiceTestResponse**](VoiceTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_voice_tests** +> VoiceTests get_voice_tests(aid=aid) + +List Voice tests + +Returns a list of Voice tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.voice_tests import VoiceTests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.VoiceTestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List Voice tests + api_response = api_instance.get_voice_tests(aid=aid) + print("The response of VoiceTestsApi->get_voice_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VoiceTestsApi->get_voice_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**VoiceTests**](VoiceTests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_voice_test** +> VoiceTestResponse update_voice_test(test_id, voice_test_request, aid=aid, expand=expand) + +Update Voice test + +Updates a Voice test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.voice_test_request import VoiceTestRequest +from thousandeyes_sdk.tests.models.voice_test_response import VoiceTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.VoiceTestsApi(api_client) + test_id = '202701' # str | Test ID + voice_test_request = thousandeyes_sdk.tests.VoiceTestRequest() # VoiceTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update Voice test + api_response = api_instance.update_voice_test(test_id, voice_test_request, aid=aid, expand=expand) + print("The response of VoiceTestsApi->update_voice_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VoiceTestsApi->update_voice_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **voice_test_request** | [**VoiceTestRequest**](VoiceTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**VoiceTestResponse**](VoiceTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-tests/docs/WebTransactionInstantTest.md b/thousandeyes-sdk-tests/docs/WebTransactionInstantTest.md index ce30fb7c6..d812b9508 100644 --- a/thousandeyes-sdk-tests/docs/WebTransactionInstantTest.md +++ b/thousandeyes-sdk-tests/docs/WebTransactionInstantTest.md @@ -24,7 +24,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] @@ -62,7 +62,6 @@ Name | Type | Description | Notes **allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] **browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] **page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] **credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] ## Example diff --git a/thousandeyes-sdk-tests/docs/WebTransactionProperties.md b/thousandeyes-sdk-tests/docs/WebTransactionProperties.md index acebb5607..72dc6bf06 100644 --- a/thousandeyes-sdk-tests/docs/WebTransactionProperties.md +++ b/thousandeyes-sdk-tests/docs/WebTransactionProperties.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] diff --git a/thousandeyes-sdk-tests/docs/WebTransactionTest.md b/thousandeyes-sdk-tests/docs/WebTransactionTest.md index 4c3d9fc25..08fc0080c 100644 --- a/thousandeyes-sdk-tests/docs/WebTransactionTest.md +++ b/thousandeyes-sdk-tests/docs/WebTransactionTest.md @@ -28,7 +28,7 @@ Name | Type | Description | Notes **client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] **content_regex** | **str** | Content regex, this field does not require escaping. | [optional] **custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] -**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. | [optional] [default to '200'] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] **download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] **dns_override** | **str** | IP address to use for DNS override. | [optional] **http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] @@ -66,7 +66,6 @@ Name | Type | Description | Notes **allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] **browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] **page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] -**agents** | [**List[Agent]**](Agent.md) | Contains list of agents. | [optional] [readonly] **credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] **bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] **use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] diff --git a/thousandeyes-sdk-tests/docs/WebTransactionTestRequest.md b/thousandeyes-sdk-tests/docs/WebTransactionTestRequest.md new file mode 100644 index 000000000..b9c7f2e23 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/WebTransactionTestRequest.md @@ -0,0 +1,95 @@ +# WebTransactionTestRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | **List[str]** | List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used) | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | **List[str]** | Contains list of test label IDs (get `labelId` from `/labels` endpoint) | [optional] +**shared_with_accounts** | **List[str]** | Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint) | [optional] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**agent_interfaces** | [**AgentInterfaces**](AgentInterfaces.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] +**download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] +**dns_override** | **str** | IP address to use for DNS override. | [optional] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**o_auth** | [**OAuth**](OAuth.md) | | [optional] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**allow_unsafe_legacy_renegotiation** | **bool** | Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation. | [optional] [default to True] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] +**emulated_device_id** | **str** | ID of the emulated device, if specified when the test was created. | [optional] +**target_time** | **int** | Target completion time. The default is 50% of the specified time limit in seconds. (Set to 0 to use the default behavior). | [optional] +**time_limit** | **int** | Time limit for transaction in seconds. | [optional] [default to 30] +**transaction_script** | **str** | JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ). | +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] +**subinterval** | [**TestSubInterval**](TestSubInterval.md) | | [optional] +**agents** | [**List[TestAgentRequest]**](TestAgentRequest.md) | Contains list of Agent IDs (get `agentId` from `/agents` endpoint). | + +## Example + +```python +from thousandeyes_sdk.tests.models.web_transaction_test_request import WebTransactionTestRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of WebTransactionTestRequest from a JSON string +web_transaction_test_request_instance = WebTransactionTestRequest.from_json(json) +# print the JSON string representation of the object +print(WebTransactionTestRequest.to_json()) + +# convert the object into a dict +web_transaction_test_request_dict = web_transaction_test_request_instance.to_dict() +# create an instance of WebTransactionTestRequest from a dict +web_transaction_test_request_from_dict = WebTransactionTestRequest.from_dict(web_transaction_test_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/WebTransactionTestResponse.md b/thousandeyes-sdk-tests/docs/WebTransactionTestResponse.md new file mode 100644 index 000000000..eb87add20 --- /dev/null +++ b/thousandeyes-sdk-tests/docs/WebTransactionTestResponse.md @@ -0,0 +1,95 @@ +# WebTransactionTestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**alert_rules** | [**List[AlertRule]**](AlertRule.md) | Contains list of enabled alert rule objects. | [optional] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | **str** | | [optional] [readonly] +**links** | [**TestLinks**](TestLinks.md) | | [optional] +**labels** | [**List[TestLabel]**](TestLabel.md) | | [optional] [readonly] +**shared_with_accounts** | [**List[SharedWithAccount]**](SharedWithAccount.md) | | [optional] [readonly] +**auth_type** | [**TestAuthType**](TestAuthType.md) | | [optional] +**agent_interfaces** | [**AgentInterfaces**](AgentInterfaces.md) | | [optional] +**bandwidth_measurements** | **bool** | Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. | [optional] +**client_certificate** | **str** | String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. | [optional] +**content_regex** | **str** | Content regex, this field does not require escaping. | [optional] +**custom_headers** | [**TestCustomHeaders**](TestCustomHeaders.md) | | [optional] +**desired_status_code** | **str** | Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. | [optional] [default to 'default'] +**download_limit** | **int** | Specifies maximum number of bytes to download from the target object. | [optional] +**dns_override** | **str** | IP address to use for DNS override. | [optional] +**http_target_time** | **int** | Target time for HTTP server completion, specified in milliseconds. | [optional] +**http_time_limit** | **int** | HTTP time limit in seconds. | [optional] [default to 5] +**http_version** | **int** | HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. | [optional] [default to 2] +**include_headers** | **bool** | Set to `true` to capture response headers for objects loaded by the test. | [optional] [default to True] +**mtu_measurements** | **bool** | Set `true` to measure MTU sizes on network from agents to the target. | [optional] +**network_measurements** | **bool** | Enable or disable network measurements. Set to true to enable or false to disable network measurements. | [optional] [default to True] +**num_path_traces** | **int** | Number of path traces executed by the agent. | [optional] [default to 3] +**o_auth** | [**OAuth**](OAuth.md) | | [optional] +**password** | **str** | Password for Basic/NTLM authentication. | [optional] +**path_trace_mode** | [**TestPathTraceMode**](TestPathTraceMode.md) | | [optional] +**probe_mode** | [**TestProbeMode**](TestProbeMode.md) | | [optional] +**protocol** | [**TestProtocol**](TestProtocol.md) | | [optional] +**ssl_version** | **str** | Reflects the verbose SSL protocol version used by a test. | [optional] [readonly] +**ssl_version_id** | [**TestSslVersionId**](TestSslVersionId.md) | | [optional] +**url** | **str** | Target for the test. | +**use_ntlm** | **bool** | Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. | [optional] +**user_agent** | **str** | User-agent string to be provided during the test. | [optional] +**username** | **str** | Username for Basic/NTLM authentication. | [optional] +**verify_certificate** | **bool** | Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. | [optional] [default to False] +**allow_unsafe_legacy_renegotiation** | **bool** | Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation. | [optional] [default to True] +**follow_redirects** | **bool** | To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. | [optional] [default to True] +**fixed_packet_rate** | **int** | Sets packets rate sent to measure the network in packets per second. | [optional] +**override_agent_proxy** | **bool** | Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. | [optional] [default to False] +**override_proxy_id** | **str** | ID of the proxy to be used if the default proxy is overridden. | [optional] +**collect_proxy_network_data** | **bool** | Indicates whether network data to the proxy should be collected. | [optional] [default to False] +**emulated_device_id** | **str** | ID of the emulated device, if specified when the test was created. | [optional] +**target_time** | **int** | Target completion time. The default is 50% of the specified time limit in seconds. (Set to 0 to use the default behavior). | [optional] +**time_limit** | **int** | Time limit for transaction in seconds. | [optional] [default to 30] +**transaction_script** | **str** | JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ). | +**block_domains** | **str** | Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. | [optional] +**disable_screenshot** | **bool** | Enables or disables screenshots on error. Set true to not capture | [optional] [default to False] +**allow_mic_and_camera** | **bool** | Set true allow the use of a fake mic and camera in the browser. | [optional] [default to False] +**allow_geolocation** | **bool** | Set true to use the agent’s geolocation by the web page. | [optional] [default to False] +**browser_language** | **str** | Set one of the available browser language that you want to use to configure the browser. | [optional] +**page_loading_strategy** | [**TestPageLoadingStrategy**](TestPageLoadingStrategy.md) | | [optional] +**credentials** | **List[str]** | Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). | [optional] +**bgp_measurements** | **bool** | Set to `true` to enable bgp measurements. | [optional] [default to True] +**use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] +**monitors** | [**List[Monitor]**](Monitor.md) | Contains list of enabled BGP monitors. | [optional] [readonly] +**subinterval** | [**TestSubInterval**](TestSubInterval.md) | | [optional] +**agents** | [**List[AgentResponse]**](AgentResponse.md) | Contains list of agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.tests.models.web_transaction_test_response import WebTransactionTestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of WebTransactionTestResponse from a JSON string +web_transaction_test_response_instance = WebTransactionTestResponse.from_json(json) +# print the JSON string representation of the object +print(WebTransactionTestResponse.to_json()) + +# convert the object into a dict +web_transaction_test_response_dict = web_transaction_test_response_instance.to_dict() +# create an instance of WebTransactionTestResponse from a dict +web_transaction_test_response_from_dict = WebTransactionTestResponse.from_dict(web_transaction_test_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-tests/docs/WebTransactionTestsApi.md b/thousandeyes-sdk-tests/docs/WebTransactionTestsApi.md new file mode 100644 index 000000000..84eefe62c --- /dev/null +++ b/thousandeyes-sdk-tests/docs/WebTransactionTestsApi.md @@ -0,0 +1,458 @@ +# thousandeyes_sdk.tests.WebTransactionTestsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_web_transactions_test**](WebTransactionTestsApi.md#create_web_transactions_test) | **POST** /tests/web-transactions | Create Web Transactions test +[**delete_web_transactions_test**](WebTransactionTestsApi.md#delete_web_transactions_test) | **DELETE** /tests/web-transactions/{testId} | Delete Web Transactions test +[**get_web_transactions_test**](WebTransactionTestsApi.md#get_web_transactions_test) | **GET** /tests/web-transactions/{testId} | Get Web Transactions test +[**get_web_transactions_tests**](WebTransactionTestsApi.md#get_web_transactions_tests) | **GET** /tests/web-transactions | List Web Transactions tests +[**update_web_transactions_test**](WebTransactionTestsApi.md#update_web_transactions_test) | **PUT** /tests/web-transactions/{testId} | Update Web Transactions test + + +# **create_web_transactions_test** +> WebTransactionTestResponse create_web_transactions_test(web_transaction_test_request, aid=aid, expand=expand) + +Create Web Transactions test + +Creates a new Web Transactions test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.web_transaction_test_request import WebTransactionTestRequest +from thousandeyes_sdk.tests.models.web_transaction_test_response import WebTransactionTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.WebTransactionTestsApi(api_client) + web_transaction_test_request = thousandeyes_sdk.tests.WebTransactionTestRequest() # WebTransactionTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Create Web Transactions test + api_response = api_instance.create_web_transactions_test(web_transaction_test_request, aid=aid, expand=expand) + print("The response of WebTransactionTestsApi->create_web_transactions_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebTransactionTestsApi->create_web_transactions_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **web_transaction_test_request** | [**WebTransactionTestRequest**](WebTransactionTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**WebTransactionTestResponse**](WebTransactionTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_web_transactions_test** +> delete_web_transactions_test(test_id, aid=aid) + +Delete Web Transactions test + +Deletes the specified Web Transactions test. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.WebTransactionTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete Web Transactions test + api_instance.delete_web_transactions_test(test_id, aid=aid) + except Exception as e: + print("Exception when calling WebTransactionTestsApi->delete_web_transactions_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_web_transactions_test** +> WebTransactionTestResponse get_web_transactions_test(test_id, aid=aid, expand=expand) + +Get Web Transactions test + +Returns details for a Web Transactions test, including name, intervals, targets, alert rules and agents. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.web_transaction_test_response import WebTransactionTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.WebTransactionTestsApi(api_client) + test_id = '202701' # str | Test ID + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Get Web Transactions test + api_response = api_instance.get_web_transactions_test(test_id, aid=aid, expand=expand) + print("The response of WebTransactionTestsApi->get_web_transactions_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebTransactionTestsApi->get_web_transactions_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**WebTransactionTestResponse**](WebTransactionTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_web_transactions_tests** +> WebTransactionTests get_web_transactions_tests(aid=aid) + +List Web Transactions tests + +Returns a list of all Web Transactions tests and saved events. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.web_transaction_tests import WebTransactionTests +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.WebTransactionTestsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List Web Transactions tests + api_response = api_instance.get_web_transactions_tests(aid=aid) + print("The response of WebTransactionTestsApi->get_web_transactions_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebTransactionTestsApi->get_web_transactions_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**WebTransactionTests**](WebTransactionTests.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_web_transactions_test** +> WebTransactionTestResponse update_web_transactions_test(test_id, web_transaction_test_request, aid=aid, expand=expand) + +Update Web Transactions test + +Updates a Web Transactions test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.tests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.web_transaction_test_request import WebTransactionTestRequest +from thousandeyes_sdk.tests.models.web_transaction_test_response import WebTransactionTestResponse +from thousandeyes_sdk.tests.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.tests.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.tests.WebTransactionTestsApi(api_client) + test_id = '202701' # str | Test ID + web_transaction_test_request = thousandeyes_sdk.tests.WebTransactionTestRequest() # WebTransactionTestRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional) + + try: + # Update Web Transactions test + api_response = api_instance.update_web_transactions_test(test_id, web_transaction_test_request, aid=aid, expand=expand) + print("The response of WebTransactionTestsApi->update_web_transactions_test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebTransactionTestsApi->update_web_transactions_test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_id** | **str**| Test ID | + **web_transaction_test_request** | [**WebTransactionTestRequest**](WebTransactionTestRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. | [optional] + +### Return type + +[**WebTransactionTestResponse**](WebTransactionTestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/__init__.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/__init__.py index 87e754a00..f9aa8e3ca 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/__init__.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/__init__.py @@ -14,36 +14,39 @@ # import apis into sdk package -from thousandeyes_sdk.tests.api.api_api import APIApi -from thousandeyes_sdk.tests.api.agent_to_agent_api import AgentToAgentApi -from thousandeyes_sdk.tests.api.agent_to_server_api import AgentToServerApi -from thousandeyes_sdk.tests.api.all_test_types_api import AllTestTypesApi -from thousandeyes_sdk.tests.api.bgp_api import BGPApi -from thousandeyes_sdk.tests.api.dnssec_api import DNSSECApi -from thousandeyes_sdk.tests.api.dns_server_api import DNSServerApi -from thousandeyes_sdk.tests.api.dns_trace_api import DNSTraceApi -from thousandeyes_sdk.tests.api.ftp_server_api import FTPServerApi -from thousandeyes_sdk.tests.api.http_server_api import HTTPServerApi -from thousandeyes_sdk.tests.api.page_load_api import PageLoadApi +from thousandeyes_sdk.tests.api.api_tests_api import APITestsApi +from thousandeyes_sdk.tests.api.agent_to_agent_tests_api import AgentToAgentTestsApi +from thousandeyes_sdk.tests.api.agent_to_server_tests_api import AgentToServerTestsApi +from thousandeyes_sdk.tests.api.bgp_tests_api import BGPTestsApi +from thousandeyes_sdk.tests.api.dnssec_tests_api import DNSSECTestsApi +from thousandeyes_sdk.tests.api.dns_server_tests_api import DNSServerTestsApi +from thousandeyes_sdk.tests.api.dns_trace_tests_api import DNSTraceTestsApi +from thousandeyes_sdk.tests.api.ftp_server_tests_api import FTPServerTestsApi +from thousandeyes_sdk.tests.api.http_server_tests_api import HTTPServerTestsApi +from thousandeyes_sdk.tests.api.page_load_tests_api import PageLoadTestsApi from thousandeyes_sdk.tests.api.path_visualization_interface_groups_api import PathVisualizationInterfaceGroupsApi -from thousandeyes_sdk.tests.api.sip_server_api import SIPServerApi -from thousandeyes_sdk.tests.api.voice_api import VoiceApi -from thousandeyes_sdk.tests.api.web_transaction_api import WebTransactionApi +from thousandeyes_sdk.tests.api.sip_server_tests_api import SIPServerTestsApi +from thousandeyes_sdk.tests.api.tests_api import TestsApi +from thousandeyes_sdk.tests.api.voice_tests_api import VoiceTestsApi +from thousandeyes_sdk.tests.api.web_transaction_tests_api import WebTransactionTestsApi # import models into sdk package -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.agent_base import AgentBase from thousandeyes_sdk.tests.models.agent_interfaces import AgentInterfaces -from thousandeyes_sdk.tests.models.agent_request import AgentRequest +from thousandeyes_sdk.tests.models.agent_response import AgentResponse from thousandeyes_sdk.tests.models.agent_to_agent_instant_test import AgentToAgentInstantTest from thousandeyes_sdk.tests.models.agent_to_agent_properties import AgentToAgentProperties from thousandeyes_sdk.tests.models.agent_to_agent_test import AgentToAgentTest from thousandeyes_sdk.tests.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol +from thousandeyes_sdk.tests.models.agent_to_agent_test_request import AgentToAgentTestRequest +from thousandeyes_sdk.tests.models.agent_to_agent_test_response import AgentToAgentTestResponse from thousandeyes_sdk.tests.models.agent_to_agent_tests import AgentToAgentTests from thousandeyes_sdk.tests.models.agent_to_server_instant_test import AgentToServerInstantTest from thousandeyes_sdk.tests.models.agent_to_server_properties import AgentToServerProperties from thousandeyes_sdk.tests.models.agent_to_server_test import AgentToServerTest +from thousandeyes_sdk.tests.models.agent_to_server_test_request import AgentToServerTestRequest +from thousandeyes_sdk.tests.models.agent_to_server_test_response import AgentToServerTestResponse from thousandeyes_sdk.tests.models.agent_to_server_tests import AgentToServerTests from thousandeyes_sdk.tests.models.alert_direction import AlertDirection from thousandeyes_sdk.tests.models.alert_rounds_violation_mode import AlertRoundsViolationMode @@ -61,38 +64,53 @@ from thousandeyes_sdk.tests.models.api_request_method import ApiRequestMethod from thousandeyes_sdk.tests.models.api_request_variable import ApiRequestVariable from thousandeyes_sdk.tests.models.api_test import ApiTest +from thousandeyes_sdk.tests.models.api_test_request import ApiTestRequest +from thousandeyes_sdk.tests.models.api_test_response import ApiTestResponse from thousandeyes_sdk.tests.models.api_tests import ApiTests from thousandeyes_sdk.tests.models.base_bgp_test import BaseBgpTest from thousandeyes_sdk.tests.models.base_request import BaseRequest from thousandeyes_sdk.tests.models.base_test import BaseTest from thousandeyes_sdk.tests.models.bgp_test import BgpTest +from thousandeyes_sdk.tests.models.bgp_test_request import BgpTestRequest +from thousandeyes_sdk.tests.models.bgp_test_response import BgpTestResponse from thousandeyes_sdk.tests.models.bgp_tests import BgpTests from thousandeyes_sdk.tests.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType from thousandeyes_sdk.tests.models.dns_query_class import DnsQueryClass from thousandeyes_sdk.tests.models.dns_sec_instant_test import DnsSecInstantTest from thousandeyes_sdk.tests.models.dns_sec_properties import DnsSecProperties from thousandeyes_sdk.tests.models.dns_sec_test import DnsSecTest +from thousandeyes_sdk.tests.models.dns_sec_test_request import DnsSecTestRequest +from thousandeyes_sdk.tests.models.dns_sec_test_response import DnsSecTestResponse from thousandeyes_sdk.tests.models.dns_sec_tests import DnsSecTests from thousandeyes_sdk.tests.models.dns_server_instant_test import DnsServerInstantTest from thousandeyes_sdk.tests.models.dns_server_properties import DnsServerProperties from thousandeyes_sdk.tests.models.dns_server_test import DnsServerTest +from thousandeyes_sdk.tests.models.dns_server_test_request import DnsServerTestRequest +from thousandeyes_sdk.tests.models.dns_server_test_response import DnsServerTestResponse from thousandeyes_sdk.tests.models.dns_server_tests import DnsServerTests from thousandeyes_sdk.tests.models.dns_servers_request import DnsServersRequest from thousandeyes_sdk.tests.models.dns_trace_instant_test import DnsTraceInstantTest from thousandeyes_sdk.tests.models.dns_trace_properties import DnsTraceProperties from thousandeyes_sdk.tests.models.dns_trace_test import DnsTraceTest +from thousandeyes_sdk.tests.models.dns_trace_test_request import DnsTraceTestRequest +from thousandeyes_sdk.tests.models.dns_trace_test_response import DnsTraceTestResponse from thousandeyes_sdk.tests.models.dns_trace_tests import DnsTraceTests from thousandeyes_sdk.tests.models.error import Error -from thousandeyes_sdk.tests.models.expand import Expand +from thousandeyes_sdk.tests.models.expand_bgp_test_options import ExpandBgpTestOptions +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions from thousandeyes_sdk.tests.models.ftp_server_instant_test import FtpServerInstantTest from thousandeyes_sdk.tests.models.ftp_server_properties import FtpServerProperties from thousandeyes_sdk.tests.models.ftp_server_request_type import FtpServerRequestType from thousandeyes_sdk.tests.models.ftp_server_test import FtpServerTest +from thousandeyes_sdk.tests.models.ftp_server_test_request import FtpServerTestRequest +from thousandeyes_sdk.tests.models.ftp_server_test_response import FtpServerTestResponse from thousandeyes_sdk.tests.models.ftp_server_tests import FtpServerTests from thousandeyes_sdk.tests.models.http_server_base_properties import HttpServerBaseProperties from thousandeyes_sdk.tests.models.http_server_instant_test import HttpServerInstantTest from thousandeyes_sdk.tests.models.http_server_properties import HttpServerProperties from thousandeyes_sdk.tests.models.http_server_test import HttpServerTest +from thousandeyes_sdk.tests.models.http_server_test_request import HttpServerTestRequest +from thousandeyes_sdk.tests.models.http_server_test_response import HttpServerTestResponse from thousandeyes_sdk.tests.models.http_server_tests import HttpServerTests from thousandeyes_sdk.tests.models.instant_test import InstantTest from thousandeyes_sdk.tests.models.interface_group import InterfaceGroup @@ -105,6 +123,8 @@ from thousandeyes_sdk.tests.models.page_load_instant_test import PageLoadInstantTest from thousandeyes_sdk.tests.models.page_load_properties import PageLoadProperties from thousandeyes_sdk.tests.models.page_load_test import PageLoadTest +from thousandeyes_sdk.tests.models.page_load_test_request import PageLoadTestRequest +from thousandeyes_sdk.tests.models.page_load_test_response import PageLoadTestResponse from thousandeyes_sdk.tests.models.page_load_tests import PageLoadTests from thousandeyes_sdk.tests.models.request_method import RequestMethod from thousandeyes_sdk.tests.models.self_links import SelfLinks @@ -114,12 +134,13 @@ from thousandeyes_sdk.tests.models.simple_agent import SimpleAgent from thousandeyes_sdk.tests.models.simple_test import SimpleTest from thousandeyes_sdk.tests.models.sip_server_instant_test import SipServerInstantTest -from thousandeyes_sdk.tests.models.sip_server_instant_test_request import SipServerInstantTestRequest -from thousandeyes_sdk.tests.models.sip_server_instant_test_response import SipServerInstantTestResponse from thousandeyes_sdk.tests.models.sip_server_properties import SipServerProperties from thousandeyes_sdk.tests.models.sip_server_test import SipServerTest +from thousandeyes_sdk.tests.models.sip_server_test_request import SipServerTestRequest +from thousandeyes_sdk.tests.models.sip_server_test_response import SipServerTestResponse from thousandeyes_sdk.tests.models.sip_server_tests import SipServerTests from thousandeyes_sdk.tests.models.sip_test_protocol import SipTestProtocol +from thousandeyes_sdk.tests.models.test_agent_request import TestAgentRequest from thousandeyes_sdk.tests.models.test_auth_type import TestAuthType from thousandeyes_sdk.tests.models.test_custom_headers import TestCustomHeaders from thousandeyes_sdk.tests.models.test_direction import TestDirection @@ -159,28 +180,19 @@ from thousandeyes_sdk.tests.models.unexpanded_test import UnexpandedTest from thousandeyes_sdk.tests.models.unexpanded_voice_test import UnexpandedVoiceTest from thousandeyes_sdk.tests.models.unexpanded_web_transaction_test import UnexpandedWebTransactionTest -from thousandeyes_sdk.tests.models.update_agent_to_agent_test import UpdateAgentToAgentTest -from thousandeyes_sdk.tests.models.update_agent_to_server_test import UpdateAgentToServerTest -from thousandeyes_sdk.tests.models.update_api_test import UpdateApiTest -from thousandeyes_sdk.tests.models.update_bgp_test import UpdateBgpTest from thousandeyes_sdk.tests.models.update_bgp_test_request import UpdateBgpTestRequest -from thousandeyes_sdk.tests.models.update_dns_sec_test import UpdateDnsSecTest -from thousandeyes_sdk.tests.models.update_dns_server_test import UpdateDnsServerTest -from thousandeyes_sdk.tests.models.update_dns_trace_test import UpdateDnsTraceTest -from thousandeyes_sdk.tests.models.update_ftp_server_test import UpdateFtpServerTest -from thousandeyes_sdk.tests.models.update_http_server_test import UpdateHttpServerTest -from thousandeyes_sdk.tests.models.update_page_load_test import UpdatePageLoadTest from thousandeyes_sdk.tests.models.update_sip_server_test import UpdateSipServerTest -from thousandeyes_sdk.tests.models.update_sip_server_test1 import UpdateSipServerTest1 -from thousandeyes_sdk.tests.models.update_voice_test import UpdateVoiceTest -from thousandeyes_sdk.tests.models.update_web_transaction_test import UpdateWebTransactionTest from thousandeyes_sdk.tests.models.validation_error import ValidationError from thousandeyes_sdk.tests.models.validation_error_item import ValidationErrorItem from thousandeyes_sdk.tests.models.voice_instant_test import VoiceInstantTest from thousandeyes_sdk.tests.models.voice_properties import VoiceProperties from thousandeyes_sdk.tests.models.voice_test import VoiceTest +from thousandeyes_sdk.tests.models.voice_test_request import VoiceTestRequest +from thousandeyes_sdk.tests.models.voice_test_response import VoiceTestResponse from thousandeyes_sdk.tests.models.voice_tests import VoiceTests from thousandeyes_sdk.tests.models.web_transaction_instant_test import WebTransactionInstantTest from thousandeyes_sdk.tests.models.web_transaction_properties import WebTransactionProperties from thousandeyes_sdk.tests.models.web_transaction_test import WebTransactionTest +from thousandeyes_sdk.tests.models.web_transaction_test_request import WebTransactionTestRequest +from thousandeyes_sdk.tests.models.web_transaction_test_response import WebTransactionTestResponse from thousandeyes_sdk.tests.models.web_transaction_tests import WebTransactionTests diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/__init__.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/__init__.py index ef55b2ed0..fabae759a 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/__init__.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/__init__.py @@ -1,19 +1,19 @@ # flake8: noqa # import apis into api package -from thousandeyes_sdk.tests.api.api_api import APIApi -from thousandeyes_sdk.tests.api.agent_to_agent_api import AgentToAgentApi -from thousandeyes_sdk.tests.api.agent_to_server_api import AgentToServerApi -from thousandeyes_sdk.tests.api.all_test_types_api import AllTestTypesApi -from thousandeyes_sdk.tests.api.bgp_api import BGPApi -from thousandeyes_sdk.tests.api.dnssec_api import DNSSECApi -from thousandeyes_sdk.tests.api.dns_server_api import DNSServerApi -from thousandeyes_sdk.tests.api.dns_trace_api import DNSTraceApi -from thousandeyes_sdk.tests.api.ftp_server_api import FTPServerApi -from thousandeyes_sdk.tests.api.http_server_api import HTTPServerApi -from thousandeyes_sdk.tests.api.page_load_api import PageLoadApi +from thousandeyes_sdk.tests.api.api_tests_api import APITestsApi +from thousandeyes_sdk.tests.api.agent_to_agent_tests_api import AgentToAgentTestsApi +from thousandeyes_sdk.tests.api.agent_to_server_tests_api import AgentToServerTestsApi +from thousandeyes_sdk.tests.api.bgp_tests_api import BGPTestsApi +from thousandeyes_sdk.tests.api.dnssec_tests_api import DNSSECTestsApi +from thousandeyes_sdk.tests.api.dns_server_tests_api import DNSServerTestsApi +from thousandeyes_sdk.tests.api.dns_trace_tests_api import DNSTraceTestsApi +from thousandeyes_sdk.tests.api.ftp_server_tests_api import FTPServerTestsApi +from thousandeyes_sdk.tests.api.http_server_tests_api import HTTPServerTestsApi +from thousandeyes_sdk.tests.api.page_load_tests_api import PageLoadTestsApi from thousandeyes_sdk.tests.api.path_visualization_interface_groups_api import PathVisualizationInterfaceGroupsApi -from thousandeyes_sdk.tests.api.sip_server_api import SIPServerApi -from thousandeyes_sdk.tests.api.voice_api import VoiceApi -from thousandeyes_sdk.tests.api.web_transaction_api import WebTransactionApi +from thousandeyes_sdk.tests.api.sip_server_tests_api import SIPServerTestsApi +from thousandeyes_sdk.tests.api.tests_api import TestsApi +from thousandeyes_sdk.tests.api.voice_tests_api import VoiceTestsApi +from thousandeyes_sdk.tests.api.web_transaction_tests_api import WebTransactionTestsApi diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/agent_to_agent_tests_api.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/agent_to_agent_tests_api.py new file mode 100644 index 000000000..c94376ca3 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/agent_to_agent_tests_api.py @@ -0,0 +1,1615 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.agent_to_agent_test_request import AgentToAgentTestRequest +from thousandeyes_sdk.tests.models.agent_to_agent_test_response import AgentToAgentTestResponse +from thousandeyes_sdk.tests.models.agent_to_agent_tests import AgentToAgentTests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class AgentToAgentTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-tests")) + self.api_client = api_client + + + @validate_call + def create_agent_to_agent_test( + self, + agent_to_agent_test_request: AgentToAgentTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AgentToAgentTestResponse: + """Create Agent to Agent test + + Creates a new Agent to Agent test. This method requires Account Admin permissions. + + :param agent_to_agent_test_request: (required) + :type agent_to_agent_test_request: AgentToAgentTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_agent_test_serialize( + agent_to_agent_test_request=agent_to_agent_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AgentToAgentTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def create_agent_to_agent_test_with_http_info( + self, + agent_to_agent_test_request: AgentToAgentTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AgentToAgentTestResponse]: + """Create Agent to Agent test + + Creates a new Agent to Agent test. This method requires Account Admin permissions. + + :param agent_to_agent_test_request: (required) + :type agent_to_agent_test_request: AgentToAgentTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_agent_test_serialize( + agent_to_agent_test_request=agent_to_agent_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AgentToAgentTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def create_agent_to_agent_test_without_preload_content( + self, + agent_to_agent_test_request: AgentToAgentTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Agent to Agent test + + Creates a new Agent to Agent test. This method requires Account Admin permissions. + + :param agent_to_agent_test_request: (required) + :type agent_to_agent_test_request: AgentToAgentTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_agent_test_serialize( + agent_to_agent_test_request=agent_to_agent_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AgentToAgentTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_agent_to_agent_test_serialize( + self, + agent_to_agent_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if agent_to_agent_test_request is not None: + _body_params = agent_to_agent_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/agent-to-agent', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_agent_to_agent_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete Agent to Agent test + + Deletes the specified Agent to Agent test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_agent_to_agent_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def delete_agent_to_agent_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Agent to Agent test + + Deletes the specified Agent to Agent test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_agent_to_agent_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def delete_agent_to_agent_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Agent to Agent test + + Deletes the specified Agent to Agent test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_agent_to_agent_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_agent_to_agent_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/tests/agent-to-agent/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_agent_to_agent_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AgentToAgentTestResponse: + """Get Agent to Agent test + + Returns details for a Agent to Agent test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_agent_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToAgentTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_agent_to_agent_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AgentToAgentTestResponse]: + """Get Agent to Agent test + + Returns details for a Agent to Agent test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_agent_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToAgentTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_agent_to_agent_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Agent to Agent test + + Returns details for a Agent to Agent test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_agent_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToAgentTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_to_agent_test_serialize( + self, + test_id, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/agent-to-agent/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_agent_to_agent_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AgentToAgentTests: + """List Agent to Agent tests + + Returns a list of Agent to Agent tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_agent_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToAgentTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_agent_to_agent_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AgentToAgentTests]: + """List Agent to Agent tests + + Returns a list of Agent to Agent tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_agent_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToAgentTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_agent_to_agent_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Agent to Agent tests + + Returns a list of Agent to Agent tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_agent_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToAgentTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_to_agent_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/agent-to-agent', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_agent_to_agent_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_to_agent_test_request: AgentToAgentTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AgentToAgentTestResponse: + """Update Agent to Agent test + + Updates a Agent to Agent test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_to_agent_test_request: (required) + :type agent_to_agent_test_request: AgentToAgentTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_agent_to_agent_test_serialize( + test_id=test_id, + agent_to_agent_test_request=agent_to_agent_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToAgentTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def update_agent_to_agent_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_to_agent_test_request: AgentToAgentTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AgentToAgentTestResponse]: + """Update Agent to Agent test + + Updates a Agent to Agent test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_to_agent_test_request: (required) + :type agent_to_agent_test_request: AgentToAgentTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_agent_to_agent_test_serialize( + test_id=test_id, + agent_to_agent_test_request=agent_to_agent_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToAgentTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def update_agent_to_agent_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_to_agent_test_request: AgentToAgentTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Agent to Agent test + + Updates a Agent to Agent test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_to_agent_test_request: (required) + :type agent_to_agent_test_request: AgentToAgentTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_agent_to_agent_test_serialize( + test_id=test_id, + agent_to_agent_test_request=agent_to_agent_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToAgentTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_agent_to_agent_test_serialize( + self, + test_id, + agent_to_agent_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if agent_to_agent_test_request is not None: + _body_params = agent_to_agent_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/tests/agent-to-agent/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/agent_to_server_tests_api.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/agent_to_server_tests_api.py new file mode 100644 index 000000000..73a2ade7b --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/agent_to_server_tests_api.py @@ -0,0 +1,1615 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.agent_to_server_test_request import AgentToServerTestRequest +from thousandeyes_sdk.tests.models.agent_to_server_test_response import AgentToServerTestResponse +from thousandeyes_sdk.tests.models.agent_to_server_tests import AgentToServerTests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class AgentToServerTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-tests")) + self.api_client = api_client + + + @validate_call + def create_agent_to_server_test( + self, + agent_to_server_test_request: AgentToServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AgentToServerTestResponse: + """Create Agent to Server test + + Creates a new Agent to Server test. This method requires Account Admin permissions. + + :param agent_to_server_test_request: (required) + :type agent_to_server_test_request: AgentToServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_server_test_serialize( + agent_to_server_test_request=agent_to_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AgentToServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def create_agent_to_server_test_with_http_info( + self, + agent_to_server_test_request: AgentToServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AgentToServerTestResponse]: + """Create Agent to Server test + + Creates a new Agent to Server test. This method requires Account Admin permissions. + + :param agent_to_server_test_request: (required) + :type agent_to_server_test_request: AgentToServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_server_test_serialize( + agent_to_server_test_request=agent_to_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AgentToServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def create_agent_to_server_test_without_preload_content( + self, + agent_to_server_test_request: AgentToServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Agent to Server test + + Creates a new Agent to Server test. This method requires Account Admin permissions. + + :param agent_to_server_test_request: (required) + :type agent_to_server_test_request: AgentToServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_to_server_test_serialize( + agent_to_server_test_request=agent_to_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AgentToServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_agent_to_server_test_serialize( + self, + agent_to_server_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if agent_to_server_test_request is not None: + _body_params = agent_to_server_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/agent-to-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_agent_to_server_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete Agent to Server test + + Deletes an Agent to Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_agent_to_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def delete_agent_to_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Agent to Server test + + Deletes an Agent to Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_agent_to_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def delete_agent_to_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Agent to Server test + + Deletes an Agent to Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_agent_to_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_agent_to_server_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/tests/agent-to-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_agent_to_server_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AgentToServerTestResponse: + """Get Agent to Server test + + Returns details for a Agent to Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToServerTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_agent_to_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AgentToServerTestResponse]: + """Get Agent to Server test + + Returns details for a Agent to Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToServerTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_agent_to_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Agent to Server test + + Returns details for a Agent to Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToServerTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_to_server_test_serialize( + self, + test_id, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/agent-to-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_agent_to_server_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AgentToServerTests: + """List Agent to Server tests + + Returns a list of Agent to Server tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToServerTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_agent_to_server_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AgentToServerTests]: + """List Agent to Server tests + + Returns a list of Agent to Server tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToServerTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_agent_to_server_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Agent to Server tests + + Returns a list of Agent to Server tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_to_server_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToServerTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_to_server_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/agent-to-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_agent_to_server_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_to_server_test_request: AgentToServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AgentToServerTestResponse: + """Update Agent to Server test + + Updates an Agent to Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_to_server_test_request: (required) + :type agent_to_server_test_request: AgentToServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_agent_to_server_test_serialize( + test_id=test_id, + agent_to_server_test_request=agent_to_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def update_agent_to_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_to_server_test_request: AgentToServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AgentToServerTestResponse]: + """Update Agent to Server test + + Updates an Agent to Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_to_server_test_request: (required) + :type agent_to_server_test_request: AgentToServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_agent_to_server_test_serialize( + test_id=test_id, + agent_to_server_test_request=agent_to_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def update_agent_to_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + agent_to_server_test_request: AgentToServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Agent to Server test + + Updates an Agent to Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param agent_to_server_test_request: (required) + :type agent_to_server_test_request: AgentToServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_agent_to_server_test_serialize( + test_id=test_id, + agent_to_server_test_request=agent_to_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentToServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_agent_to_server_test_serialize( + self, + test_id, + agent_to_server_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if agent_to_server_test_request is not None: + _body_params = agent_to_server_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/tests/agent-to-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/api_tests_api.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/api_tests_api.py new file mode 100644 index 000000000..420e9d47e --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/api_tests_api.py @@ -0,0 +1,1615 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.api_test_request import ApiTestRequest +from thousandeyes_sdk.tests.models.api_test_response import ApiTestResponse +from thousandeyes_sdk.tests.models.api_tests import ApiTests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class APITestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-tests")) + self.api_client = api_client + + + @validate_call + def create_api_test( + self, + api_test_request: ApiTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiTestResponse: + """Create API test + + Creates a new API test. This method requires Account Admin permissions. + + :param api_test_request: (required) + :type api_test_request: ApiTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_api_test_serialize( + api_test_request=api_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def create_api_test_with_http_info( + self, + api_test_request: ApiTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ApiTestResponse]: + """Create API test + + Creates a new API test. This method requires Account Admin permissions. + + :param api_test_request: (required) + :type api_test_request: ApiTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_api_test_serialize( + api_test_request=api_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def create_api_test_without_preload_content( + self, + api_test_request: ApiTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create API test + + Creates a new API test. This method requires Account Admin permissions. + + :param api_test_request: (required) + :type api_test_request: ApiTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_api_test_serialize( + api_test_request=api_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_api_test_serialize( + self, + api_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if api_test_request is not None: + _body_params = api_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/api', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_api_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete API test + + Deletes the specified API test. This method requires write permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_api_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def delete_api_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete API test + + Deletes the specified API test. This method requires write permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_api_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def delete_api_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete API test + + Deletes the specified API test. This method requires write permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_api_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_api_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/tests/api/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_api_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiTestResponse: + """Get API test + + Returns details for a API test configuration. Please use `expand` parameter to access sub-resources such as alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_api_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_api_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ApiTestResponse]: + """Get API test + + Returns details for a API test configuration. Please use `expand` parameter to access sub-resources such as alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_api_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_api_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get API test + + Returns details for a API test configuration. Please use `expand` parameter to access sub-resources such as alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_api_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_api_test_serialize( + self, + test_id, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/api/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_api_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiTests: + """List API tests + + Returns a list of all API tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_api_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_api_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ApiTests]: + """List API tests + + Returns a list of all API tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_api_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_api_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List API tests + + Returns a list of all API tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_api_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_api_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/api', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_api_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + api_test_request: ApiTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiTestResponse: + """Update API test + + Updates an API test. The target test cannot be a live share or saved event. This method requires write permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param api_test_request: (required) + :type api_test_request: ApiTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_api_test_serialize( + test_id=test_id, + api_test_request=api_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def update_api_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + api_test_request: ApiTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ApiTestResponse]: + """Update API test + + Updates an API test. The target test cannot be a live share or saved event. This method requires write permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param api_test_request: (required) + :type api_test_request: ApiTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_api_test_serialize( + test_id=test_id, + api_test_request=api_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def update_api_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + api_test_request: ApiTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update API test + + Updates an API test. The target test cannot be a live share or saved event. This method requires write permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param api_test_request: (required) + :type api_test_request: ApiTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_api_test_serialize( + test_id=test_id, + api_test_request=api_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_api_test_serialize( + self, + test_id, + api_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if api_test_request is not None: + _body_params = api_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/tests/api/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/bgp_tests_api.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/bgp_tests_api.py new file mode 100644 index 000000000..43458a793 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/bgp_tests_api.py @@ -0,0 +1,1616 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.bgp_test_request import BgpTestRequest +from thousandeyes_sdk.tests.models.bgp_test_response import BgpTestResponse +from thousandeyes_sdk.tests.models.bgp_tests import BgpTests +from thousandeyes_sdk.tests.models.expand_bgp_test_options import ExpandBgpTestOptions +from thousandeyes_sdk.tests.models.update_bgp_test_request import UpdateBgpTestRequest + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class BGPTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-tests")) + self.api_client = api_client + + + @validate_call + def create_bgp_test( + self, + bgp_test_request: BgpTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandBgpTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BgpTestResponse: + """Create BGP test + + Creates a new BGP test. This method requires Account Admin permissions. + + :param bgp_test_request: (required) + :type bgp_test_request: BgpTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query. + :type expand: List[ExpandBgpTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_bgp_test_serialize( + bgp_test_request=bgp_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BgpTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def create_bgp_test_with_http_info( + self, + bgp_test_request: BgpTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandBgpTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BgpTestResponse]: + """Create BGP test + + Creates a new BGP test. This method requires Account Admin permissions. + + :param bgp_test_request: (required) + :type bgp_test_request: BgpTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query. + :type expand: List[ExpandBgpTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_bgp_test_serialize( + bgp_test_request=bgp_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BgpTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def create_bgp_test_without_preload_content( + self, + bgp_test_request: BgpTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandBgpTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create BGP test + + Creates a new BGP test. This method requires Account Admin permissions. + + :param bgp_test_request: (required) + :type bgp_test_request: BgpTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query. + :type expand: List[ExpandBgpTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_bgp_test_serialize( + bgp_test_request=bgp_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BgpTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_bgp_test_serialize( + self, + bgp_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if bgp_test_request is not None: + _body_params = bgp_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/bgp', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_bgp_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete BGP test + + Deletes a BGP test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_bgp_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def delete_bgp_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete BGP test + + Deletes a BGP test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_bgp_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def delete_bgp_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete BGP test + + Deletes a BGP test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_bgp_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_bgp_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/tests/bgp/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_bgp_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandBgpTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BgpTestResponse: + """Get BGP test + + Returns details for a BGP test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query. + :type expand: List[ExpandBgpTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bgp_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_bgp_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandBgpTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BgpTestResponse]: + """Get BGP test + + Returns details for a BGP test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query. + :type expand: List[ExpandBgpTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bgp_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_bgp_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandBgpTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get BGP test + + Returns details for a BGP test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query. + :type expand: List[ExpandBgpTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bgp_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_bgp_test_serialize( + self, + test_id, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/bgp/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_bgp_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BgpTests: + """List BGP tests + + Returns a list of BGP tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bgp_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_bgp_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BgpTests]: + """List BGP tests + + Returns a list of BGP tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bgp_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_bgp_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List BGP tests + + Returns a list of BGP tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bgp_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_bgp_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/bgp', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_bgp_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + update_bgp_test_request: UpdateBgpTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandBgpTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BgpTestResponse: + """Update BGP test + + Updates a BGP test. This method requires Account Admin permissions. The target test cannot be a live share or saved event. + + :param test_id: Test ID (required) + :type test_id: str + :param update_bgp_test_request: (required) + :type update_bgp_test_request: UpdateBgpTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query. + :type expand: List[ExpandBgpTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_bgp_test_serialize( + test_id=test_id, + update_bgp_test_request=update_bgp_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def update_bgp_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + update_bgp_test_request: UpdateBgpTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandBgpTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BgpTestResponse]: + """Update BGP test + + Updates a BGP test. This method requires Account Admin permissions. The target test cannot be a live share or saved event. + + :param test_id: Test ID (required) + :type test_id: str + :param update_bgp_test_request: (required) + :type update_bgp_test_request: UpdateBgpTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query. + :type expand: List[ExpandBgpTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_bgp_test_serialize( + test_id=test_id, + update_bgp_test_request=update_bgp_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def update_bgp_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + update_bgp_test_request: UpdateBgpTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandBgpTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update BGP test + + Updates a BGP test. This method requires Account Admin permissions. The target test cannot be a live share or saved event. + + :param test_id: Test ID (required) + :type test_id: str + :param update_bgp_test_request: (required) + :type update_bgp_test_request: UpdateBgpTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion takes place if the query parameter is not present. To expand the `monitors` sub-resource, pass the `?expand=monitor` query. + :type expand: List[ExpandBgpTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_bgp_test_serialize( + test_id=test_id, + update_bgp_test_request=update_bgp_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_bgp_test_serialize( + self, + test_id, + update_bgp_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if update_bgp_test_request is not None: + _body_params = update_bgp_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/tests/bgp/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/dns_server_tests_api.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/dns_server_tests_api.py new file mode 100644 index 000000000..c8113013f --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/dns_server_tests_api.py @@ -0,0 +1,1615 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.dns_server_test_request import DnsServerTestRequest +from thousandeyes_sdk.tests.models.dns_server_test_response import DnsServerTestResponse +from thousandeyes_sdk.tests.models.dns_server_tests import DnsServerTests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class DNSServerTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-tests")) + self.api_client = api_client + + + @validate_call + def create_dns_server_test( + self, + dns_server_test_request: DnsServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsServerTestResponse: + """Create DNS Server test + + Creates a new DNS Server test. This method requires Account Admin permissions. + + :param dns_server_test_request: (required) + :type dns_server_test_request: DnsServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_server_test_serialize( + dns_server_test_request=dns_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def create_dns_server_test_with_http_info( + self, + dns_server_test_request: DnsServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsServerTestResponse]: + """Create DNS Server test + + Creates a new DNS Server test. This method requires Account Admin permissions. + + :param dns_server_test_request: (required) + :type dns_server_test_request: DnsServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_server_test_serialize( + dns_server_test_request=dns_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def create_dns_server_test_without_preload_content( + self, + dns_server_test_request: DnsServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create DNS Server test + + Creates a new DNS Server test. This method requires Account Admin permissions. + + :param dns_server_test_request: (required) + :type dns_server_test_request: DnsServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_server_test_serialize( + dns_server_test_request=dns_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_dns_server_test_serialize( + self, + dns_server_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if dns_server_test_request is not None: + _body_params = dns_server_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/dns-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_dns_server_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete DNS Server test + + Deletes the specified DNS Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_dns_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def delete_dns_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete DNS Server test + + Deletes the specified DNS Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_dns_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def delete_dns_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete DNS Server test + + Deletes the specified DNS Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_dns_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_dns_server_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/tests/dns-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_dns_server_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsServerTestResponse: + """Get DNS Server test + + Returns details for a DNS Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_server_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsServerTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_dns_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsServerTestResponse]: + """Get DNS Server test + + Returns details for a DNS Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_server_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsServerTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_dns_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get DNS Server test + + Returns details for a DNS Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_server_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsServerTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_dns_server_test_serialize( + self, + test_id, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/dns-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_dns_server_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsServerTests: + """List DNS Server tests + + Returns a list of all DNS Server tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_server_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsServerTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_dns_server_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsServerTests]: + """List DNS Server tests + + Returns a list of all DNS Server tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_server_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsServerTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_dns_server_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List DNS Server tests + + Returns a list of all DNS Server tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_server_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsServerTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_dns_server_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/dns-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_dns_server_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + dns_server_test_request: DnsServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsServerTestResponse: + """Update DNS Server test + + Updates a DNS Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param dns_server_test_request: (required) + :type dns_server_test_request: DnsServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_dns_server_test_serialize( + test_id=test_id, + dns_server_test_request=dns_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def update_dns_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + dns_server_test_request: DnsServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsServerTestResponse]: + """Update DNS Server test + + Updates a DNS Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param dns_server_test_request: (required) + :type dns_server_test_request: DnsServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_dns_server_test_serialize( + test_id=test_id, + dns_server_test_request=dns_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def update_dns_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + dns_server_test_request: DnsServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update DNS Server test + + Updates a DNS Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param dns_server_test_request: (required) + :type dns_server_test_request: DnsServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_dns_server_test_serialize( + test_id=test_id, + dns_server_test_request=dns_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_dns_server_test_serialize( + self, + test_id, + dns_server_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if dns_server_test_request is not None: + _body_params = dns_server_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/tests/dns-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/dns_trace_tests_api.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/dns_trace_tests_api.py new file mode 100644 index 000000000..bb7a00456 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/dns_trace_tests_api.py @@ -0,0 +1,1615 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.dns_trace_test_request import DnsTraceTestRequest +from thousandeyes_sdk.tests.models.dns_trace_test_response import DnsTraceTestResponse +from thousandeyes_sdk.tests.models.dns_trace_tests import DnsTraceTests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class DNSTraceTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-tests")) + self.api_client = api_client + + + @validate_call + def create_dns_trace_test( + self, + dns_trace_test_request: DnsTraceTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsTraceTestResponse: + """Create DNS Trace test + + Creates a new DNS Trace test. This method requires Account Admin permissions. + + :param dns_trace_test_request: (required) + :type dns_trace_test_request: DnsTraceTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_trace_test_serialize( + dns_trace_test_request=dns_trace_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsTraceTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def create_dns_trace_test_with_http_info( + self, + dns_trace_test_request: DnsTraceTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsTraceTestResponse]: + """Create DNS Trace test + + Creates a new DNS Trace test. This method requires Account Admin permissions. + + :param dns_trace_test_request: (required) + :type dns_trace_test_request: DnsTraceTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_trace_test_serialize( + dns_trace_test_request=dns_trace_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsTraceTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def create_dns_trace_test_without_preload_content( + self, + dns_trace_test_request: DnsTraceTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create DNS Trace test + + Creates a new DNS Trace test. This method requires Account Admin permissions. + + :param dns_trace_test_request: (required) + :type dns_trace_test_request: DnsTraceTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_trace_test_serialize( + dns_trace_test_request=dns_trace_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsTraceTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_dns_trace_test_serialize( + self, + dns_trace_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if dns_trace_test_request is not None: + _body_params = dns_trace_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/dns-trace', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_dns_trace_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete DNS Trace test + + Deletes the specified DNS Trace test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_dns_trace_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def delete_dns_trace_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete DNS Trace test + + Deletes the specified DNS Trace test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_dns_trace_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def delete_dns_trace_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete DNS Trace test + + Deletes the specified DNS Trace test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_dns_trace_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_dns_trace_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/tests/dns-trace/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_dns_trace_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsTraceTestResponse: + """Get DNS Trace test + + Returns details for a DNS Trace test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_trace_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsTraceTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_dns_trace_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsTraceTestResponse]: + """Get DNS Trace test + + Returns details for a DNS Trace test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_trace_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsTraceTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_dns_trace_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get DNS Trace test + + Returns details for a DNS Trace test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_trace_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsTraceTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_dns_trace_test_serialize( + self, + test_id, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/dns-trace/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_dns_trace_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsTraceTests: + """List DNS Trace tests + + Returns a list of all DNS Trace tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_trace_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsTraceTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_dns_trace_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsTraceTests]: + """List DNS Trace tests + + Returns a list of all DNS Trace tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_trace_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsTraceTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_dns_trace_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List DNS Trace tests + + Returns a list of all DNS Trace tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_trace_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsTraceTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_dns_trace_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/dns-trace', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_dns_trace_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + dns_trace_test_request: DnsTraceTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsTraceTestResponse: + """Update DNS Trace test + + Updates a DNS Trace test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param dns_trace_test_request: (required) + :type dns_trace_test_request: DnsTraceTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_dns_trace_test_serialize( + test_id=test_id, + dns_trace_test_request=dns_trace_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsTraceTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def update_dns_trace_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + dns_trace_test_request: DnsTraceTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsTraceTestResponse]: + """Update DNS Trace test + + Updates a DNS Trace test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param dns_trace_test_request: (required) + :type dns_trace_test_request: DnsTraceTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_dns_trace_test_serialize( + test_id=test_id, + dns_trace_test_request=dns_trace_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsTraceTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def update_dns_trace_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + dns_trace_test_request: DnsTraceTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update DNS Trace test + + Updates a DNS Trace test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param dns_trace_test_request: (required) + :type dns_trace_test_request: DnsTraceTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_dns_trace_test_serialize( + test_id=test_id, + dns_trace_test_request=dns_trace_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsTraceTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_dns_trace_test_serialize( + self, + test_id, + dns_trace_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if dns_trace_test_request is not None: + _body_params = dns_trace_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/tests/dns-trace/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/dnssec_tests_api.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/dnssec_tests_api.py new file mode 100644 index 000000000..d8fa79038 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/dnssec_tests_api.py @@ -0,0 +1,1615 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.dns_sec_test_request import DnsSecTestRequest +from thousandeyes_sdk.tests.models.dns_sec_test_response import DnsSecTestResponse +from thousandeyes_sdk.tests.models.dns_sec_tests import DnsSecTests +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class DNSSECTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-tests")) + self.api_client = api_client + + + @validate_call + def create_dns_sec_test( + self, + dns_sec_test_request: DnsSecTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsSecTestResponse: + """Create DNSSEC test + + Creates a new DNSSEC test. This method requires Account Admin permissions. + + :param dns_sec_test_request: (required) + :type dns_sec_test_request: DnsSecTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_sec_test_serialize( + dns_sec_test_request=dns_sec_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsSecTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def create_dns_sec_test_with_http_info( + self, + dns_sec_test_request: DnsSecTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsSecTestResponse]: + """Create DNSSEC test + + Creates a new DNSSEC test. This method requires Account Admin permissions. + + :param dns_sec_test_request: (required) + :type dns_sec_test_request: DnsSecTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_sec_test_serialize( + dns_sec_test_request=dns_sec_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsSecTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def create_dns_sec_test_without_preload_content( + self, + dns_sec_test_request: DnsSecTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create DNSSEC test + + Creates a new DNSSEC test. This method requires Account Admin permissions. + + :param dns_sec_test_request: (required) + :type dns_sec_test_request: DnsSecTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dns_sec_test_serialize( + dns_sec_test_request=dns_sec_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DnsSecTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_dns_sec_test_serialize( + self, + dns_sec_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if dns_sec_test_request is not None: + _body_params = dns_sec_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/dnssec', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_dns_sec_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete DNSSEC test + + Deletes the specified DNSSEC test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_dns_sec_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def delete_dns_sec_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete DNSSEC test + + Deletes the specified DNSSEC test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_dns_sec_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def delete_dns_sec_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete DNSSEC test + + Deletes the specified DNSSEC test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_dns_sec_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_dns_sec_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/tests/dnssec/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_dns_sec_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsSecTestResponse: + """Get DNSSEC test + + Returns details for a DNSSEC test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_sec_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsSecTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_dns_sec_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsSecTestResponse]: + """Get DNSSEC test + + Returns details for a DNSSEC test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_sec_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsSecTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_dns_sec_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get DNSSEC test + + Returns details for a DNSSEC test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_sec_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsSecTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_dns_sec_test_serialize( + self, + test_id, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/dnssec/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_dns_sec_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsSecTests: + """List DNSSEC tests + + Returns a list of all DNSSEC tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_sec_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsSecTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_dns_sec_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsSecTests]: + """List DNSSEC tests + + Returns a list of all DNSSEC tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_sec_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsSecTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_dns_sec_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List DNSSEC tests + + Returns a list of all DNSSEC tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dns_sec_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsSecTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_dns_sec_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/dnssec', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_dns_sec_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + dns_sec_test_request: DnsSecTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DnsSecTestResponse: + """Update DNSSEC test + + Updates a DNSSEC test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param dns_sec_test_request: (required) + :type dns_sec_test_request: DnsSecTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_dns_sec_test_serialize( + test_id=test_id, + dns_sec_test_request=dns_sec_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsSecTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def update_dns_sec_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + dns_sec_test_request: DnsSecTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DnsSecTestResponse]: + """Update DNSSEC test + + Updates a DNSSEC test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param dns_sec_test_request: (required) + :type dns_sec_test_request: DnsSecTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_dns_sec_test_serialize( + test_id=test_id, + dns_sec_test_request=dns_sec_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsSecTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def update_dns_sec_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + dns_sec_test_request: DnsSecTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update DNSSEC test + + Updates a DNSSEC test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param dns_sec_test_request: (required) + :type dns_sec_test_request: DnsSecTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_dns_sec_test_serialize( + test_id=test_id, + dns_sec_test_request=dns_sec_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DnsSecTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_dns_sec_test_serialize( + self, + test_id, + dns_sec_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if dns_sec_test_request is not None: + _body_params = dns_sec_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/tests/dnssec/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/ftp_server_tests_api.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/ftp_server_tests_api.py new file mode 100644 index 000000000..c2fd159ef --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/ftp_server_tests_api.py @@ -0,0 +1,1612 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.ftp_server_test_request import FtpServerTestRequest +from thousandeyes_sdk.tests.models.ftp_server_test_response import FtpServerTestResponse +from thousandeyes_sdk.tests.models.ftp_server_tests import FtpServerTests + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class FTPServerTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-tests")) + self.api_client = api_client + + + @validate_call + def create_ftp_server_test( + self, + ftp_server_test_request: FtpServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FtpServerTestResponse: + """Create FTP Server test + + Creates a new FTP Server test. This method requires Account Admin permissions. + + :param ftp_server_test_request: (required) + :type ftp_server_test_request: FtpServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ftp_server_test_serialize( + ftp_server_test_request=ftp_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "FtpServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def create_ftp_server_test_with_http_info( + self, + ftp_server_test_request: FtpServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FtpServerTestResponse]: + """Create FTP Server test + + Creates a new FTP Server test. This method requires Account Admin permissions. + + :param ftp_server_test_request: (required) + :type ftp_server_test_request: FtpServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ftp_server_test_serialize( + ftp_server_test_request=ftp_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "FtpServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def create_ftp_server_test_without_preload_content( + self, + ftp_server_test_request: FtpServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create FTP Server test + + Creates a new FTP Server test. This method requires Account Admin permissions. + + :param ftp_server_test_request: (required) + :type ftp_server_test_request: FtpServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ftp_server_test_serialize( + ftp_server_test_request=ftp_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "FtpServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_ftp_server_test_serialize( + self, + ftp_server_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if ftp_server_test_request is not None: + _body_params = ftp_server_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/ftp-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_ftp_server_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete FTP Server test + + Deletes the specified FTP Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_ftp_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def delete_ftp_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete FTP Server test + + Deletes the specified FTP Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_ftp_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def delete_ftp_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete FTP Server test + + Deletes the specified FTP Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_ftp_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_ftp_server_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/tests/ftp-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_ftp_server_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FtpServerTestResponse: + """Get FTP Server test + + Returns details for a FTP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ftp_server_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FtpServerTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_ftp_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FtpServerTestResponse]: + """Get FTP Server test + + Returns details for a FTP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ftp_server_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FtpServerTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_ftp_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get FTP Server test + + Returns details for a FTP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ftp_server_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FtpServerTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_ftp_server_test_serialize( + self, + test_id, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/ftp-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_ftp_server_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FtpServerTests: + """List FTP Server tests + + Returns a list of FTP Server tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ftp_server_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FtpServerTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_ftp_server_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FtpServerTests]: + """List FTP Server tests + + Returns a list of FTP Server tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ftp_server_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FtpServerTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_ftp_server_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List FTP Server tests + + Returns a list of FTP Server tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ftp_server_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FtpServerTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_ftp_server_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/ftp-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_ftp_server_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + ftp_server_test_request: FtpServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FtpServerTestResponse: + """Update FTP Server test + + Updates a FTP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param ftp_server_test_request: (required) + :type ftp_server_test_request: FtpServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_ftp_server_test_serialize( + test_id=test_id, + ftp_server_test_request=ftp_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FtpServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def update_ftp_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + ftp_server_test_request: FtpServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FtpServerTestResponse]: + """Update FTP Server test + + Updates a FTP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param ftp_server_test_request: (required) + :type ftp_server_test_request: FtpServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_ftp_server_test_serialize( + test_id=test_id, + ftp_server_test_request=ftp_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FtpServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def update_ftp_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + ftp_server_test_request: FtpServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update FTP Server test + + Updates a FTP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param ftp_server_test_request: (required) + :type ftp_server_test_request: FtpServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_ftp_server_test_serialize( + test_id=test_id, + ftp_server_test_request=ftp_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FtpServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_ftp_server_test_serialize( + self, + test_id, + ftp_server_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if ftp_server_test_request is not None: + _body_params = ftp_server_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/tests/ftp-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/http_server_tests_api.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/http_server_tests_api.py new file mode 100644 index 000000000..3fa9480d1 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/http_server_tests_api.py @@ -0,0 +1,1615 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.http_server_test_request import HttpServerTestRequest +from thousandeyes_sdk.tests.models.http_server_test_response import HttpServerTestResponse +from thousandeyes_sdk.tests.models.http_server_tests import HttpServerTests + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class HTTPServerTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-tests")) + self.api_client = api_client + + + @validate_call + def create_http_server_test( + self, + http_server_test_request: HttpServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HttpServerTestResponse: + """Create HTTP Server test + + Creates a new HTTP Server test. This method requires Account Admin permissions. + + :param http_server_test_request: (required) + :type http_server_test_request: HttpServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_http_server_test_serialize( + http_server_test_request=http_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "HttpServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def create_http_server_test_with_http_info( + self, + http_server_test_request: HttpServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HttpServerTestResponse]: + """Create HTTP Server test + + Creates a new HTTP Server test. This method requires Account Admin permissions. + + :param http_server_test_request: (required) + :type http_server_test_request: HttpServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_http_server_test_serialize( + http_server_test_request=http_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "HttpServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def create_http_server_test_without_preload_content( + self, + http_server_test_request: HttpServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create HTTP Server test + + Creates a new HTTP Server test. This method requires Account Admin permissions. + + :param http_server_test_request: (required) + :type http_server_test_request: HttpServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_http_server_test_serialize( + http_server_test_request=http_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "HttpServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_http_server_test_serialize( + self, + http_server_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if http_server_test_request is not None: + _body_params = http_server_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/http-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_http_server_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete HTTP Server test + + Deletes the specified HTTP Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_http_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def delete_http_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete HTTP Server test + + Deletes the specified HTTP Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_http_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def delete_http_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete HTTP Server test + + Deletes the specified HTTP Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_http_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_http_server_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/tests/http-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_http_server_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HttpServerTestResponse: + """Get HTTP Server test + + Returns details for a HTTP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_http_server_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpServerTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_http_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HttpServerTestResponse]: + """Get HTTP Server test + + Returns details for a HTTP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_http_server_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpServerTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_http_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get HTTP Server test + + Returns details for a HTTP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_http_server_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpServerTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_http_server_test_serialize( + self, + test_id, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/http-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_http_server_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HttpServerTests: + """List HTTP Server tests + + Returns a list of all HTTP Server tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_http_server_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpServerTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_http_server_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HttpServerTests]: + """List HTTP Server tests + + Returns a list of all HTTP Server tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_http_server_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpServerTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_http_server_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List HTTP Server tests + + Returns a list of all HTTP Server tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_http_server_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpServerTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_http_server_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/http-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_http_server_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + http_server_test_request: HttpServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HttpServerTestResponse: + """Update HTTP Server test + + Updates a HTTP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param http_server_test_request: (required) + :type http_server_test_request: HttpServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_http_server_test_serialize( + test_id=test_id, + http_server_test_request=http_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def update_http_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + http_server_test_request: HttpServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HttpServerTestResponse]: + """Update HTTP Server test + + Updates a HTTP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param http_server_test_request: (required) + :type http_server_test_request: HttpServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_http_server_test_serialize( + test_id=test_id, + http_server_test_request=http_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def update_http_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + http_server_test_request: HttpServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update HTTP Server test + + Updates a HTTP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param http_server_test_request: (required) + :type http_server_test_request: HttpServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_http_server_test_serialize( + test_id=test_id, + http_server_test_request=http_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HttpServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_http_server_test_serialize( + self, + test_id, + http_server_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if http_server_test_request is not None: + _body_params = http_server_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/tests/http-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/page_load_tests_api.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/page_load_tests_api.py new file mode 100644 index 000000000..06a8780a3 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/page_load_tests_api.py @@ -0,0 +1,1615 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.page_load_test_request import PageLoadTestRequest +from thousandeyes_sdk.tests.models.page_load_test_response import PageLoadTestResponse +from thousandeyes_sdk.tests.models.page_load_tests import PageLoadTests + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class PageLoadTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-tests")) + self.api_client = api_client + + + @validate_call + def create_page_load_test( + self, + page_load_test_request: PageLoadTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PageLoadTestResponse: + """Create Page Load test + + Creates a new Page Load test. This method requires Account Admin permissions. + + :param page_load_test_request: (required) + :type page_load_test_request: PageLoadTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_page_load_test_serialize( + page_load_test_request=page_load_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PageLoadTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def create_page_load_test_with_http_info( + self, + page_load_test_request: PageLoadTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PageLoadTestResponse]: + """Create Page Load test + + Creates a new Page Load test. This method requires Account Admin permissions. + + :param page_load_test_request: (required) + :type page_load_test_request: PageLoadTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_page_load_test_serialize( + page_load_test_request=page_load_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PageLoadTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def create_page_load_test_without_preload_content( + self, + page_load_test_request: PageLoadTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Page Load test + + Creates a new Page Load test. This method requires Account Admin permissions. + + :param page_load_test_request: (required) + :type page_load_test_request: PageLoadTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_page_load_test_serialize( + page_load_test_request=page_load_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PageLoadTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_page_load_test_serialize( + self, + page_load_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if page_load_test_request is not None: + _body_params = page_load_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/page-load', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_page_load_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete Page Load test + + Deletes the specified Page Load test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_page_load_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def delete_page_load_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Page Load test + + Deletes the specified Page Load test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_page_load_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def delete_page_load_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Page Load test + + Deletes the specified Page Load test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_page_load_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_page_load_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/tests/page-load/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_page_load_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PageLoadTestResponse: + """Get Page Load test + + Returns details for a Page Load test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_page_load_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageLoadTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_page_load_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PageLoadTestResponse]: + """Get Page Load test + + Returns details for a Page Load test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_page_load_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageLoadTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_page_load_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Page Load test + + Returns details for a Page Load test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_page_load_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageLoadTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_page_load_test_serialize( + self, + test_id, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/page-load/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_page_load_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PageLoadTests: + """List Page Load tests + + Returns a list of all Page Load tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_page_load_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageLoadTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_page_load_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PageLoadTests]: + """List Page Load tests + + Returns a list of all Page Load tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_page_load_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageLoadTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_page_load_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Page Load tests + + Returns a list of all Page Load tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_page_load_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageLoadTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_page_load_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/page-load', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_page_load_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + page_load_test_request: PageLoadTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PageLoadTestResponse: + """Update Page Load test + + Updates a Page Load test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param page_load_test_request: (required) + :type page_load_test_request: PageLoadTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_page_load_test_serialize( + test_id=test_id, + page_load_test_request=page_load_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageLoadTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def update_page_load_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + page_load_test_request: PageLoadTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PageLoadTestResponse]: + """Update Page Load test + + Updates a Page Load test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param page_load_test_request: (required) + :type page_load_test_request: PageLoadTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_page_load_test_serialize( + test_id=test_id, + page_load_test_request=page_load_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageLoadTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def update_page_load_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + page_load_test_request: PageLoadTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Page Load test + + Updates a Page Load test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param page_load_test_request: (required) + :type page_load_test_request: PageLoadTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_page_load_test_serialize( + test_id=test_id, + page_load_test_request=page_load_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageLoadTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_page_load_test_serialize( + self, + test_id, + page_load_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if page_load_test_request is not None: + _body_params = page_load_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/tests/page-load/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/sip_server_tests_api.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/sip_server_tests_api.py new file mode 100644 index 000000000..83e93afec --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/sip_server_tests_api.py @@ -0,0 +1,1612 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.sip_server_test_request import SipServerTestRequest +from thousandeyes_sdk.tests.models.sip_server_test_response import SipServerTestResponse +from thousandeyes_sdk.tests.models.sip_server_tests import SipServerTests + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class SIPServerTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-tests")) + self.api_client = api_client + + + @validate_call + def create_sip_server_test( + self, + sip_server_test_request: SipServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SipServerTestResponse: + """Create SIP Server test + + Creates a new SIP Server test. This method requires Account Admin permissions. + + :param sip_server_test_request: (required) + :type sip_server_test_request: SipServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_sip_server_test_serialize( + sip_server_test_request=sip_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SipServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def create_sip_server_test_with_http_info( + self, + sip_server_test_request: SipServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SipServerTestResponse]: + """Create SIP Server test + + Creates a new SIP Server test. This method requires Account Admin permissions. + + :param sip_server_test_request: (required) + :type sip_server_test_request: SipServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_sip_server_test_serialize( + sip_server_test_request=sip_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SipServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def create_sip_server_test_without_preload_content( + self, + sip_server_test_request: SipServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create SIP Server test + + Creates a new SIP Server test. This method requires Account Admin permissions. + + :param sip_server_test_request: (required) + :type sip_server_test_request: SipServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_sip_server_test_serialize( + sip_server_test_request=sip_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SipServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_sip_server_test_serialize( + self, + sip_server_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if sip_server_test_request is not None: + _body_params = sip_server_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/sip-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_sip_server_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete SIP Server test + + Deletes the specified SIP Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_sip_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def delete_sip_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete SIP Server test + + Deletes the specified SIP Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_sip_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def delete_sip_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete SIP Server test + + Deletes the specified SIP Server test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_sip_server_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_sip_server_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/tests/sip-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_sip_server_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SipServerTestResponse: + """Get SIP Server test + + Returns details for a SIP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_sip_server_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SipServerTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_sip_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SipServerTestResponse]: + """Get SIP Server test + + Returns details for a SIP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_sip_server_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SipServerTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_sip_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get SIP Server test + + Returns details for a SIP Server test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_sip_server_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SipServerTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_sip_server_test_serialize( + self, + test_id, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/sip-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_sip_server_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SipServerTests: + """List SIP Server tests + + Returns a list of SIP Server tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_sip_server_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SipServerTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_sip_server_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SipServerTests]: + """List SIP Server tests + + Returns a list of SIP Server tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_sip_server_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SipServerTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_sip_server_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List SIP Server tests + + Returns a list of SIP Server tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_sip_server_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SipServerTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_sip_server_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/sip-server', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_sip_server_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + sip_server_test_request: SipServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SipServerTestResponse: + """Update SIP Server test + + Updates a SIP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param sip_server_test_request: (required) + :type sip_server_test_request: SipServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_sip_server_test_serialize( + test_id=test_id, + sip_server_test_request=sip_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SipServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def update_sip_server_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + sip_server_test_request: SipServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SipServerTestResponse]: + """Update SIP Server test + + Updates a SIP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param sip_server_test_request: (required) + :type sip_server_test_request: SipServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_sip_server_test_serialize( + test_id=test_id, + sip_server_test_request=sip_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SipServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def update_sip_server_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + sip_server_test_request: SipServerTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update SIP Server test + + Updates a SIP Server test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param sip_server_test_request: (required) + :type sip_server_test_request: SipServerTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_sip_server_test_serialize( + test_id=test_id, + sip_server_test_request=sip_server_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SipServerTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_sip_server_test_serialize( + self, + test_id, + sip_server_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if sip_server_test_request is not None: + _body_params = sip_server_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/tests/sip-server/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/tests_api.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/tests_api.py new file mode 100644 index 000000000..32b300e4d --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/tests_api.py @@ -0,0 +1,324 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.tests.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.tests import Tests + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class TestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-tests")) + self.api_client = api_client + + + @validate_call + def get_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Tests: + """List configured tests + + Returns configured tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Tests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Tests]: + """List configured tests + + Returns configured tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Tests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List configured tests + + Returns configured tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Tests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/voice_tests_api.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/voice_tests_api.py new file mode 100644 index 000000000..151b36ec3 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/voice_tests_api.py @@ -0,0 +1,1615 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.voice_test_request import VoiceTestRequest +from thousandeyes_sdk.tests.models.voice_test_response import VoiceTestResponse +from thousandeyes_sdk.tests.models.voice_tests import VoiceTests + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class VoiceTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-tests")) + self.api_client = api_client + + + @validate_call + def create_voice_test( + self, + voice_test_request: VoiceTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VoiceTestResponse: + """Create Voice test + + Creates a new Voice test. This method requires Account Admin permissions. + + :param voice_test_request: (required) + :type voice_test_request: VoiceTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_voice_test_serialize( + voice_test_request=voice_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "VoiceTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def create_voice_test_with_http_info( + self, + voice_test_request: VoiceTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VoiceTestResponse]: + """Create Voice test + + Creates a new Voice test. This method requires Account Admin permissions. + + :param voice_test_request: (required) + :type voice_test_request: VoiceTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_voice_test_serialize( + voice_test_request=voice_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "VoiceTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def create_voice_test_without_preload_content( + self, + voice_test_request: VoiceTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Voice test + + Creates a new Voice test. This method requires Account Admin permissions. + + :param voice_test_request: (required) + :type voice_test_request: VoiceTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_voice_test_serialize( + voice_test_request=voice_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "VoiceTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_voice_test_serialize( + self, + voice_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if voice_test_request is not None: + _body_params = voice_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/voice', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_voice_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete Voice test + + Deletes the specified Voice test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_voice_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def delete_voice_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Voice test + + Deletes the specified Voice test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_voice_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def delete_voice_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Voice test + + Deletes the specified Voice test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_voice_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_voice_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/tests/voice/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_voice_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VoiceTestResponse: + """Get Voice test + + Returns details for a Voice test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_voice_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VoiceTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_voice_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VoiceTestResponse]: + """Get Voice test + + Returns details for a Voice test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_voice_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VoiceTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_voice_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Voice test + + Returns details for a Voice test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_voice_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VoiceTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_voice_test_serialize( + self, + test_id, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/voice/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_voice_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VoiceTests: + """List Voice tests + + Returns a list of Voice tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_voice_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VoiceTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_voice_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VoiceTests]: + """List Voice tests + + Returns a list of Voice tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_voice_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VoiceTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_voice_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Voice tests + + Returns a list of Voice tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_voice_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VoiceTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_voice_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/voice', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_voice_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + voice_test_request: VoiceTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VoiceTestResponse: + """Update Voice test + + Updates a Voice test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param voice_test_request: (required) + :type voice_test_request: VoiceTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_voice_test_serialize( + test_id=test_id, + voice_test_request=voice_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VoiceTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def update_voice_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + voice_test_request: VoiceTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VoiceTestResponse]: + """Update Voice test + + Updates a Voice test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param voice_test_request: (required) + :type voice_test_request: VoiceTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_voice_test_serialize( + test_id=test_id, + voice_test_request=voice_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VoiceTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def update_voice_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + voice_test_request: VoiceTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Voice test + + Updates a Voice test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param voice_test_request: (required) + :type voice_test_request: VoiceTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_voice_test_serialize( + test_id=test_id, + voice_test_request=voice_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VoiceTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_voice_test_serialize( + self, + test_id, + voice_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if voice_test_request is not None: + _body_params = voice_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/tests/voice/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/web_transaction_tests_api.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/web_transaction_tests_api.py new file mode 100644 index 000000000..6aa414ee5 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/api/web_transaction_tests_api.py @@ -0,0 +1,1615 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.tests.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions +from thousandeyes_sdk.tests.models.web_transaction_test_request import WebTransactionTestRequest +from thousandeyes_sdk.tests.models.web_transaction_test_response import WebTransactionTestResponse +from thousandeyes_sdk.tests.models.web_transaction_tests import WebTransactionTests + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class WebTransactionTestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-tests")) + self.api_client = api_client + + + @validate_call + def create_web_transactions_test( + self, + web_transaction_test_request: WebTransactionTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebTransactionTestResponse: + """Create Web Transactions test + + Creates a new Web Transactions test. This method requires Account Admin permissions. + + :param web_transaction_test_request: (required) + :type web_transaction_test_request: WebTransactionTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_web_transactions_test_serialize( + web_transaction_test_request=web_transaction_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebTransactionTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def create_web_transactions_test_with_http_info( + self, + web_transaction_test_request: WebTransactionTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebTransactionTestResponse]: + """Create Web Transactions test + + Creates a new Web Transactions test. This method requires Account Admin permissions. + + :param web_transaction_test_request: (required) + :type web_transaction_test_request: WebTransactionTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_web_transactions_test_serialize( + web_transaction_test_request=web_transaction_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebTransactionTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def create_web_transactions_test_without_preload_content( + self, + web_transaction_test_request: WebTransactionTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Web Transactions test + + Creates a new Web Transactions test. This method requires Account Admin permissions. + + :param web_transaction_test_request: (required) + :type web_transaction_test_request: WebTransactionTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_web_transactions_test_serialize( + web_transaction_test_request=web_transaction_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebTransactionTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_web_transactions_test_serialize( + self, + web_transaction_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if web_transaction_test_request is not None: + _body_params = web_transaction_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tests/web-transactions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_web_transactions_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete Web Transactions test + + Deletes the specified Web Transactions test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_web_transactions_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def delete_web_transactions_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Web Transactions test + + Deletes the specified Web Transactions test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_web_transactions_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def delete_web_transactions_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Web Transactions test + + Deletes the specified Web Transactions test. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_web_transactions_test_serialize( + test_id=test_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_web_transactions_test_serialize( + self, + test_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/tests/web-transactions/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_web_transactions_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebTransactionTestResponse: + """Get Web Transactions test + + Returns details for a Web Transactions test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_web_transactions_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_web_transactions_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebTransactionTestResponse]: + """Get Web Transactions test + + Returns details for a Web Transactions test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_web_transactions_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_web_transactions_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Web Transactions test + + Returns details for a Web Transactions test, including name, intervals, targets, alert rules and agents. + + :param test_id: Test ID (required) + :type test_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_web_transactions_test_serialize( + test_id=test_id, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionTestResponse", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_web_transactions_test_serialize( + self, + test_id, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/web-transactions/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_web_transactions_tests( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebTransactionTests: + """List Web Transactions tests + + Returns a list of all Web Transactions tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_web_transactions_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def get_web_transactions_tests_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebTransactionTests]: + """List Web Transactions tests + + Returns a list of all Web Transactions tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_web_transactions_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def get_web_transactions_tests_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Web Transactions tests + + Returns a list of all Web Transactions tests and saved events. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_web_transactions_tests_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionTests", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_web_transactions_tests_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tests/web-transactions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_web_transactions_test( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + web_transaction_test_request: WebTransactionTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebTransactionTestResponse: + """Update Web Transactions test + + Updates a Web Transactions test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param web_transaction_test_request: (required) + :type web_transaction_test_request: WebTransactionTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_web_transactions_test_serialize( + test_id=test_id, + web_transaction_test_request=web_transaction_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ).data + + + @validate_call + def update_web_transactions_test_with_http_info( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + web_transaction_test_request: WebTransactionTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebTransactionTestResponse]: + """Update Web Transactions test + + Updates a Web Transactions test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param web_transaction_test_request: (required) + :type web_transaction_test_request: WebTransactionTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_web_transactions_test_serialize( + test_id=test_id, + web_transaction_test_request=web_transaction_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.tests.models, + ) + + + @validate_call + def update_web_transactions_test_without_preload_content( + self, + test_id: Annotated[StrictStr, Field(description="Test ID")], + web_transaction_test_request: WebTransactionTestRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + expand: Annotated[Optional[List[ExpandTestOptions]], Field(description="Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Web Transactions test + + Updates a Web Transactions test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. + + :param test_id: Test ID (required) + :type test_id: str + :param web_transaction_test_request: (required) + :type web_transaction_test_request: WebTransactionTestRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param expand: Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. + :type expand: List[ExpandTestOptions] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_web_transactions_test_serialize( + test_id=test_id, + web_transaction_test_request=web_transaction_test_request, + aid=aid, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebTransactionTestResponse", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_web_transactions_test_serialize( + self, + test_id, + web_transaction_test_request, + aid, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if test_id is not None: + _path_params['testId'] = test_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if web_transaction_test_request is not None: + _body_params = web_transaction_test_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/tests/web-transactions/{testId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/__init__.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/__init__.py index 691bbf891..cf19198c7 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/__init__.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/__init__.py @@ -13,18 +13,21 @@ # import models into model package -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.agent_base import AgentBase from thousandeyes_sdk.tests.models.agent_interfaces import AgentInterfaces -from thousandeyes_sdk.tests.models.agent_request import AgentRequest +from thousandeyes_sdk.tests.models.agent_response import AgentResponse from thousandeyes_sdk.tests.models.agent_to_agent_instant_test import AgentToAgentInstantTest from thousandeyes_sdk.tests.models.agent_to_agent_properties import AgentToAgentProperties from thousandeyes_sdk.tests.models.agent_to_agent_test import AgentToAgentTest from thousandeyes_sdk.tests.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol +from thousandeyes_sdk.tests.models.agent_to_agent_test_request import AgentToAgentTestRequest +from thousandeyes_sdk.tests.models.agent_to_agent_test_response import AgentToAgentTestResponse from thousandeyes_sdk.tests.models.agent_to_agent_tests import AgentToAgentTests from thousandeyes_sdk.tests.models.agent_to_server_instant_test import AgentToServerInstantTest from thousandeyes_sdk.tests.models.agent_to_server_properties import AgentToServerProperties from thousandeyes_sdk.tests.models.agent_to_server_test import AgentToServerTest +from thousandeyes_sdk.tests.models.agent_to_server_test_request import AgentToServerTestRequest +from thousandeyes_sdk.tests.models.agent_to_server_test_response import AgentToServerTestResponse from thousandeyes_sdk.tests.models.agent_to_server_tests import AgentToServerTests from thousandeyes_sdk.tests.models.alert_direction import AlertDirection from thousandeyes_sdk.tests.models.alert_rounds_violation_mode import AlertRoundsViolationMode @@ -42,38 +45,53 @@ from thousandeyes_sdk.tests.models.api_request_method import ApiRequestMethod from thousandeyes_sdk.tests.models.api_request_variable import ApiRequestVariable from thousandeyes_sdk.tests.models.api_test import ApiTest +from thousandeyes_sdk.tests.models.api_test_request import ApiTestRequest +from thousandeyes_sdk.tests.models.api_test_response import ApiTestResponse from thousandeyes_sdk.tests.models.api_tests import ApiTests from thousandeyes_sdk.tests.models.base_bgp_test import BaseBgpTest from thousandeyes_sdk.tests.models.base_request import BaseRequest from thousandeyes_sdk.tests.models.base_test import BaseTest from thousandeyes_sdk.tests.models.bgp_test import BgpTest +from thousandeyes_sdk.tests.models.bgp_test_request import BgpTestRequest +from thousandeyes_sdk.tests.models.bgp_test_response import BgpTestResponse from thousandeyes_sdk.tests.models.bgp_tests import BgpTests from thousandeyes_sdk.tests.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType from thousandeyes_sdk.tests.models.dns_query_class import DnsQueryClass from thousandeyes_sdk.tests.models.dns_sec_instant_test import DnsSecInstantTest from thousandeyes_sdk.tests.models.dns_sec_properties import DnsSecProperties from thousandeyes_sdk.tests.models.dns_sec_test import DnsSecTest +from thousandeyes_sdk.tests.models.dns_sec_test_request import DnsSecTestRequest +from thousandeyes_sdk.tests.models.dns_sec_test_response import DnsSecTestResponse from thousandeyes_sdk.tests.models.dns_sec_tests import DnsSecTests from thousandeyes_sdk.tests.models.dns_server_instant_test import DnsServerInstantTest from thousandeyes_sdk.tests.models.dns_server_properties import DnsServerProperties from thousandeyes_sdk.tests.models.dns_server_test import DnsServerTest +from thousandeyes_sdk.tests.models.dns_server_test_request import DnsServerTestRequest +from thousandeyes_sdk.tests.models.dns_server_test_response import DnsServerTestResponse from thousandeyes_sdk.tests.models.dns_server_tests import DnsServerTests from thousandeyes_sdk.tests.models.dns_servers_request import DnsServersRequest from thousandeyes_sdk.tests.models.dns_trace_instant_test import DnsTraceInstantTest from thousandeyes_sdk.tests.models.dns_trace_properties import DnsTraceProperties from thousandeyes_sdk.tests.models.dns_trace_test import DnsTraceTest +from thousandeyes_sdk.tests.models.dns_trace_test_request import DnsTraceTestRequest +from thousandeyes_sdk.tests.models.dns_trace_test_response import DnsTraceTestResponse from thousandeyes_sdk.tests.models.dns_trace_tests import DnsTraceTests from thousandeyes_sdk.tests.models.error import Error -from thousandeyes_sdk.tests.models.expand import Expand +from thousandeyes_sdk.tests.models.expand_bgp_test_options import ExpandBgpTestOptions +from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions from thousandeyes_sdk.tests.models.ftp_server_instant_test import FtpServerInstantTest from thousandeyes_sdk.tests.models.ftp_server_properties import FtpServerProperties from thousandeyes_sdk.tests.models.ftp_server_request_type import FtpServerRequestType from thousandeyes_sdk.tests.models.ftp_server_test import FtpServerTest +from thousandeyes_sdk.tests.models.ftp_server_test_request import FtpServerTestRequest +from thousandeyes_sdk.tests.models.ftp_server_test_response import FtpServerTestResponse from thousandeyes_sdk.tests.models.ftp_server_tests import FtpServerTests from thousandeyes_sdk.tests.models.http_server_base_properties import HttpServerBaseProperties from thousandeyes_sdk.tests.models.http_server_instant_test import HttpServerInstantTest from thousandeyes_sdk.tests.models.http_server_properties import HttpServerProperties from thousandeyes_sdk.tests.models.http_server_test import HttpServerTest +from thousandeyes_sdk.tests.models.http_server_test_request import HttpServerTestRequest +from thousandeyes_sdk.tests.models.http_server_test_response import HttpServerTestResponse from thousandeyes_sdk.tests.models.http_server_tests import HttpServerTests from thousandeyes_sdk.tests.models.instant_test import InstantTest from thousandeyes_sdk.tests.models.interface_group import InterfaceGroup @@ -86,6 +104,8 @@ from thousandeyes_sdk.tests.models.page_load_instant_test import PageLoadInstantTest from thousandeyes_sdk.tests.models.page_load_properties import PageLoadProperties from thousandeyes_sdk.tests.models.page_load_test import PageLoadTest +from thousandeyes_sdk.tests.models.page_load_test_request import PageLoadTestRequest +from thousandeyes_sdk.tests.models.page_load_test_response import PageLoadTestResponse from thousandeyes_sdk.tests.models.page_load_tests import PageLoadTests from thousandeyes_sdk.tests.models.request_method import RequestMethod from thousandeyes_sdk.tests.models.self_links import SelfLinks @@ -95,12 +115,13 @@ from thousandeyes_sdk.tests.models.simple_agent import SimpleAgent from thousandeyes_sdk.tests.models.simple_test import SimpleTest from thousandeyes_sdk.tests.models.sip_server_instant_test import SipServerInstantTest -from thousandeyes_sdk.tests.models.sip_server_instant_test_request import SipServerInstantTestRequest -from thousandeyes_sdk.tests.models.sip_server_instant_test_response import SipServerInstantTestResponse from thousandeyes_sdk.tests.models.sip_server_properties import SipServerProperties from thousandeyes_sdk.tests.models.sip_server_test import SipServerTest +from thousandeyes_sdk.tests.models.sip_server_test_request import SipServerTestRequest +from thousandeyes_sdk.tests.models.sip_server_test_response import SipServerTestResponse from thousandeyes_sdk.tests.models.sip_server_tests import SipServerTests from thousandeyes_sdk.tests.models.sip_test_protocol import SipTestProtocol +from thousandeyes_sdk.tests.models.test_agent_request import TestAgentRequest from thousandeyes_sdk.tests.models.test_auth_type import TestAuthType from thousandeyes_sdk.tests.models.test_custom_headers import TestCustomHeaders from thousandeyes_sdk.tests.models.test_direction import TestDirection @@ -140,28 +161,19 @@ from thousandeyes_sdk.tests.models.unexpanded_test import UnexpandedTest from thousandeyes_sdk.tests.models.unexpanded_voice_test import UnexpandedVoiceTest from thousandeyes_sdk.tests.models.unexpanded_web_transaction_test import UnexpandedWebTransactionTest -from thousandeyes_sdk.tests.models.update_agent_to_agent_test import UpdateAgentToAgentTest -from thousandeyes_sdk.tests.models.update_agent_to_server_test import UpdateAgentToServerTest -from thousandeyes_sdk.tests.models.update_api_test import UpdateApiTest -from thousandeyes_sdk.tests.models.update_bgp_test import UpdateBgpTest from thousandeyes_sdk.tests.models.update_bgp_test_request import UpdateBgpTestRequest -from thousandeyes_sdk.tests.models.update_dns_sec_test import UpdateDnsSecTest -from thousandeyes_sdk.tests.models.update_dns_server_test import UpdateDnsServerTest -from thousandeyes_sdk.tests.models.update_dns_trace_test import UpdateDnsTraceTest -from thousandeyes_sdk.tests.models.update_ftp_server_test import UpdateFtpServerTest -from thousandeyes_sdk.tests.models.update_http_server_test import UpdateHttpServerTest -from thousandeyes_sdk.tests.models.update_page_load_test import UpdatePageLoadTest from thousandeyes_sdk.tests.models.update_sip_server_test import UpdateSipServerTest -from thousandeyes_sdk.tests.models.update_sip_server_test1 import UpdateSipServerTest1 -from thousandeyes_sdk.tests.models.update_voice_test import UpdateVoiceTest -from thousandeyes_sdk.tests.models.update_web_transaction_test import UpdateWebTransactionTest from thousandeyes_sdk.tests.models.validation_error import ValidationError from thousandeyes_sdk.tests.models.validation_error_item import ValidationErrorItem from thousandeyes_sdk.tests.models.voice_instant_test import VoiceInstantTest from thousandeyes_sdk.tests.models.voice_properties import VoiceProperties from thousandeyes_sdk.tests.models.voice_test import VoiceTest +from thousandeyes_sdk.tests.models.voice_test_request import VoiceTestRequest +from thousandeyes_sdk.tests.models.voice_test_response import VoiceTestResponse from thousandeyes_sdk.tests.models.voice_tests import VoiceTests from thousandeyes_sdk.tests.models.web_transaction_instant_test import WebTransactionInstantTest from thousandeyes_sdk.tests.models.web_transaction_properties import WebTransactionProperties from thousandeyes_sdk.tests.models.web_transaction_test import WebTransactionTest +from thousandeyes_sdk.tests.models.web_transaction_test_request import WebTransactionTestRequest +from thousandeyes_sdk.tests.models.web_transaction_test_response import WebTransactionTestResponse from thousandeyes_sdk.tests.models.web_transaction_tests import WebTransactionTests diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_response.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_response.py new file mode 100644 index 000000000..597b490b5 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.tests.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from typing import Optional, Set +from typing_extensions import Self + +class AgentResponse(BaseModel): + """ + AgentResponse + """ # noqa: E501 + ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses") + public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses") + network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agent’s public IP.") + agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the agent.", alias="agentId") + agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent.", alias="agentName") + location: Optional[StrictStr] = Field(default=None, description="Location of the agent.") + country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code", alias="countryId") + enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.") + prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.") + verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates") + agent_type: CloudEnterpriseAgentType = Field(alias="agentType") + __properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "agentType"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "ip_addresses", + "public_ip_addresses", + "network", + "agent_id", + "location", + "country_id", + "prefix", + "verify_ssl_certificates", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ipAddresses": obj.get("ipAddresses"), + "publicIpAddresses": obj.get("publicIpAddresses"), + "network": obj.get("network"), + "agentId": obj.get("agentId"), + "agentName": obj.get("agentName"), + "location": obj.get("location"), + "countryId": obj.get("countryId"), + "enabled": obj.get("enabled"), + "prefix": obj.get("prefix"), + "verifySslCertificates": obj.get("verifySslCertificates"), + "agentType": obj.get("agentType") + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_agent_instant_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_agent_instant_test.py index d7edc8494..ba9e8c0ef 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_agent_instant_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_agent_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.tests.models.test_direction import TestDirection @@ -61,8 +60,7 @@ class AgentToAgentInstantTest(BaseModel): throughput_duration: Optional[Annotated[int, Field(le=30000, strict=True, ge=5000)]] = Field(default=10000, description="The throughput duration.", alias="throughputDuration") throughput_rate: Optional[Annotated[int, Field(le=1000, strict=True, ge=8)]] = Field(default=None, description="The throughput rate, only applicable for UDP protocol.", alias="throughputRate") fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate"] model_config = ConfigDict( populate_by_name=True, @@ -106,7 +104,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -120,7 +117,6 @@ def to_dict(self) -> Dict[str, Any]: "labels", "shared_with_accounts", "dscp", - "agents", ]) _dict = self.model_dump( @@ -145,13 +141,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -189,8 +178,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "throughputMeasurements": obj.get("throughputMeasurements") if obj.get("throughputMeasurements") is not None else False, "throughputDuration": obj.get("throughputDuration") if obj.get("throughputDuration") is not None else 10000, "throughputRate": obj.get("throughputRate"), - "fixedPacketRate": obj.get("fixedPacketRate"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "fixedPacketRate": obj.get("fixedPacketRate") }) return _obj diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_agent_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_agent_test.py index fab6d7489..6b566cbd3 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_agent_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_agent_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol from thousandeyes_sdk.tests.models.alert_rule import AlertRule from thousandeyes_sdk.tests.models.monitor import Monitor @@ -68,11 +67,10 @@ class AgentToAgentTest(BaseModel): throughput_duration: Optional[Annotated[int, Field(le=30000, strict=True, ge=5000)]] = Field(default=10000, description="The throughput duration.", alias="throughputDuration") throughput_rate: Optional[Annotated[int, Field(le=1000, strict=True, ge=8)]] = Field(default=None, description="The throughput rate, only applicable for UDP protocol.", alias="throughputRate") fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") - __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate", "agents", "bgpMeasurements", "usePublicBgp", "monitors"] + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate", "bgpMeasurements", "usePublicBgp", "monitors"] model_config = ConfigDict( populate_by_name=True, @@ -117,7 +115,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -131,7 +128,6 @@ def to_dict(self) -> Dict[str, Any]: "labels", "shared_with_accounts", "dscp", - "agents", "monitors", ]) @@ -164,13 +160,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) _items = [] if self.monitors: @@ -220,7 +209,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "throughputDuration": obj.get("throughputDuration") if obj.get("throughputDuration") is not None else 10000, "throughputRate": obj.get("throughputRate"), "fixedPacketRate": obj.get("fixedPacketRate"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_agent_test_request.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_agent_test_request.py new file mode 100644 index 000000000..0551f6634 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_agent_test_request.py @@ -0,0 +1,190 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol +from thousandeyes_sdk.tests.models.test_agent_request import TestAgentRequest +from thousandeyes_sdk.tests.models.test_direction import TestDirection +from thousandeyes_sdk.tests.models.test_dscp_id import TestDscpId +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from typing import Optional, Set +from typing_extensions import Self + +class AgentToAgentTestRequest(BaseModel): + """ + AgentToAgentTestRequest + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + direction: Optional[TestDirection] = None + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + mss: Optional[Annotated[int, Field(le=1400, strict=True, ge=20)]] = Field(default=None, description="Maximum segment size, in bytes.") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + protocol: Optional[AgentToAgentTestProtocol] = None + target_agent_id: StrictStr = Field(description="`agentId` of the target agent for the test.", alias="targetAgentId") + throughput_measurements: Optional[StrictBool] = Field(default=False, description="Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent.", alias="throughputMeasurements") + throughput_duration: Optional[Annotated[int, Field(le=30000, strict=True, ge=5000)]] = Field(default=10000, description="The throughput duration.", alias="throughputDuration") + throughput_rate: Optional[Annotated[int, Field(le=1000, strict=True, ge=8)]] = Field(default=None, description="The throughput rate, only applicable for UDP protocol.", alias="throughputRate") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") + agents: List[TestAgentRequest] = Field(description="Contains list of Agent IDs (get `agentId` from `/agents` endpoint).") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate", "bgpMeasurements", "usePublicBgp", "monitors", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentToAgentTestRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "dscp", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentToAgentTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": obj.get("alertRules"), + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "direction": obj.get("direction"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "mss": obj.get("mss"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "protocol": obj.get("protocol"), + "targetAgentId": obj.get("targetAgentId"), + "throughputMeasurements": obj.get("throughputMeasurements") if obj.get("throughputMeasurements") is not None else False, + "throughputDuration": obj.get("throughputDuration") if obj.get("throughputDuration") is not None else 10000, + "throughputRate": obj.get("throughputRate"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": obj.get("monitors"), + "agents": [TestAgentRequest.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_agent_test_response.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_agent_test_response.py new file mode 100644 index 000000000..434759358 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_agent_test_response.py @@ -0,0 +1,228 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.agent_response import AgentResponse +from thousandeyes_sdk.tests.models.agent_to_agent_test_protocol import AgentToAgentTestProtocol +from thousandeyes_sdk.tests.models.alert_rule import AlertRule +from thousandeyes_sdk.tests.models.monitor import Monitor +from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.tests.models.test_direction import TestDirection +from thousandeyes_sdk.tests.models.test_dscp_id import TestDscpId +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_label import TestLabel +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from typing import Optional, Set +from typing_extensions import Self + +class AgentToAgentTestResponse(BaseModel): + """ + AgentToAgentTestResponse + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + direction: Optional[TestDirection] = None + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + mss: Optional[Annotated[int, Field(le=1400, strict=True, ge=20)]] = Field(default=None, description="Maximum segment size, in bytes.") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + protocol: Optional[AgentToAgentTestProtocol] = None + target_agent_id: StrictStr = Field(description="`agentId` of the target agent for the test.", alias="targetAgentId") + throughput_measurements: Optional[StrictBool] = Field(default=False, description="Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent.", alias="throughputMeasurements") + throughput_duration: Optional[Annotated[int, Field(le=30000, strict=True, ge=5000)]] = Field(default=10000, description="The throughput duration.", alias="throughputDuration") + throughput_rate: Optional[Annotated[int, Field(le=1000, strict=True, ge=8)]] = Field(default=None, description="The throughput rate, only applicable for UDP protocol.", alias="throughputRate") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "direction", "dscp", "dscpId", "mss", "numPathTraces", "pathTraceMode", "port", "protocol", "targetAgentId", "throughputMeasurements", "throughputDuration", "throughputRate", "fixedPacketRate", "bgpMeasurements", "usePublicBgp", "monitors", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentToAgentTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "dscp", + "monitors", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentToAgentTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "direction": obj.get("direction"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "mss": obj.get("mss"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "protocol": obj.get("protocol"), + "targetAgentId": obj.get("targetAgentId"), + "throughputMeasurements": obj.get("throughputMeasurements") if obj.get("throughputMeasurements") is not None else False, + "throughputDuration": obj.get("throughputDuration") if obj.get("throughputDuration") is not None else 10000, + "throughputRate": obj.get("throughputRate"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None, + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_instant_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_instant_test.py index 860bc8628..624131a65 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_instant_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.tests.models.test_dscp_id import TestDscpId from thousandeyes_sdk.tests.models.test_ipv6_policy import TestIpv6Policy @@ -64,8 +63,7 @@ class AgentToServerInstantTest(BaseModel): ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") ping_payload_size: Optional[Annotated[int, Field(le=1400, strict=True, ge=0)]] = Field(default=None, description="Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests.", alias="pingPayloadSize") network_measurements: Optional[StrictBool] = Field(default=False, description="View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements.", alias="networkMeasurements") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements"] model_config = ConfigDict( populate_by_name=True, @@ -109,7 +107,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -123,7 +120,6 @@ def to_dict(self) -> Dict[str, Any]: "labels", "shared_with_accounts", "dscp", - "agents", ]) _dict = self.model_dump( @@ -148,13 +144,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -194,8 +183,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "dscpId": obj.get("dscpId"), "ipv6Policy": obj.get("ipv6Policy"), "pingPayloadSize": obj.get("pingPayloadSize"), - "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else False, - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else False }) return _obj diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_test.py index d805369f2..c5d1b8436 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.alert_rule import AlertRule from thousandeyes_sdk.tests.models.monitor import Monitor from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount @@ -71,11 +70,10 @@ class AgentToServerTest(BaseModel): ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") ping_payload_size: Optional[Annotated[int, Field(le=1400, strict=True, ge=0)]] = Field(default=None, description="Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests.", alias="pingPayloadSize") network_measurements: Optional[StrictBool] = Field(default=False, description="View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements.", alias="networkMeasurements") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") - __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements", "agents", "bgpMeasurements", "usePublicBgp", "monitors"] + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements", "bgpMeasurements", "usePublicBgp", "monitors"] model_config = ConfigDict( populate_by_name=True, @@ -120,7 +118,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -134,7 +131,6 @@ def to_dict(self) -> Dict[str, Any]: "labels", "shared_with_accounts", "dscp", - "agents", "monitors", ]) @@ -167,13 +163,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) _items = [] if self.monitors: @@ -225,7 +214,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "ipv6Policy": obj.get("ipv6Policy"), "pingPayloadSize": obj.get("pingPayloadSize"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else False, - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_test_request.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_test_request.py new file mode 100644 index 000000000..52ba0cd46 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_test_request.py @@ -0,0 +1,195 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.test_agent_request import TestAgentRequest +from thousandeyes_sdk.tests.models.test_dscp_id import TestDscpId +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_ipv6_policy import TestIpv6Policy +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.tests.models.test_protocol import TestProtocol +from typing import Optional, Set +from typing_extensions import Self + +class AgentToServerTestRequest(BaseModel): + """ + AgentToServerTestRequest + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + continuous_mode: Optional[StrictBool] = Field(default=None, description="To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. ", alias="continuousMode") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1`", alias="fixedPacketRate") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + server: StrictStr = Field(description="Target name or IP address.") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + ping_payload_size: Optional[Annotated[int, Field(le=1400, strict=True, ge=0)]] = Field(default=None, description="Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests.", alias="pingPayloadSize") + network_measurements: Optional[StrictBool] = Field(default=False, description="View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements.", alias="networkMeasurements") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") + agents: List[TestAgentRequest] = Field(description="Contains list of Agent IDs (get `agentId` from `/agents` endpoint).") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements", "bgpMeasurements", "usePublicBgp", "monitors", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentToServerTestRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "dscp", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentToServerTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": obj.get("alertRules"), + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "continuousMode": obj.get("continuousMode"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "ipv6Policy": obj.get("ipv6Policy"), + "pingPayloadSize": obj.get("pingPayloadSize"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else False, + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": obj.get("monitors"), + "agents": [TestAgentRequest.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_test_response.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_test_response.py new file mode 100644 index 000000000..e5c0f5e9b --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_test_response.py @@ -0,0 +1,233 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.agent_response import AgentResponse +from thousandeyes_sdk.tests.models.alert_rule import AlertRule +from thousandeyes_sdk.tests.models.monitor import Monitor +from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.tests.models.test_dscp_id import TestDscpId +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_ipv6_policy import TestIpv6Policy +from thousandeyes_sdk.tests.models.test_label import TestLabel +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.tests.models.test_protocol import TestProtocol +from typing import Optional, Set +from typing_extensions import Self + +class AgentToServerTestResponse(BaseModel): + """ + AgentToServerTestResponse + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + continuous_mode: Optional[StrictBool] = Field(default=None, description="To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. ", alias="continuousMode") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1`", alias="fixedPacketRate") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=49153, description="Target port.") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + server: StrictStr = Field(description="Target name or IP address.") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + ping_payload_size: Optional[Annotated[int, Field(le=1400, strict=True, ge=0)]] = Field(default=None, description="Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests.", alias="pingPayloadSize") + network_measurements: Optional[StrictBool] = Field(default=False, description="View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements.", alias="networkMeasurements") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "port", "probeMode", "protocol", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements", "bgpMeasurements", "usePublicBgp", "monitors", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentToServerTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "dscp", + "monitors", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentToServerTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "continuousMode": obj.get("continuousMode"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "server": obj.get("server"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "ipv6Policy": obj.get("ipv6Policy"), + "pingPayloadSize": obj.get("pingPayloadSize"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else False, + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None, + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_instant_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_instant_test.py index 55fce0832..97a121376 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_instant_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.api_predefined_variable import ApiPredefinedVariable from thousandeyes_sdk.tests.models.api_request import ApiRequest from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount @@ -50,10 +49,13 @@ class ApiInstantTest(BaseModel): links: Optional[TestLinks] = Field(default=None, alias="_links") labels: Optional[List[TestLabel]] = None shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") predefined_variables: Optional[List[ApiPredefinedVariable]] = Field(default=None, alias="predefinedVariables") probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") @@ -63,9 +65,8 @@ class ApiInstantTest(BaseModel): target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=0)]] = Field(default=None, description="Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior)", alias="targetTime") time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error.", alias="timeLimit") url: StrictStr = Field(description="Target for the test.") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "agents", "credentials"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "collectProxyNetworkData", "followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "overrideAgentProxy", "overrideProxyId", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "credentials"] model_config = ConfigDict( populate_by_name=True, @@ -108,7 +109,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -121,7 +121,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", ]) _dict = self.model_dump( @@ -160,13 +159,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['requests'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -192,10 +184,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, "mtuMeasurements": obj.get("mtuMeasurements"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), "pathTraceMode": obj.get("pathTraceMode"), "predefinedVariables": [ApiPredefinedVariable.from_dict(_item) for _item in obj["predefinedVariables"]] if obj.get("predefinedVariables") is not None else None, "probeMode": obj.get("probeMode"), @@ -205,7 +200,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "targetTime": obj.get("targetTime"), "timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30, "url": obj.get("url"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, "credentials": obj.get("credentials") }) return _obj diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_properties.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_properties.py index 20346527e..f3221a60d 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_properties.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_properties.py @@ -32,10 +32,13 @@ class ApiProperties(BaseModel): """ ApiProperties """ # noqa: E501 + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") predefined_variables: Optional[List[ApiPredefinedVariable]] = Field(default=None, alias="predefinedVariables") probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") @@ -46,7 +49,7 @@ class ApiProperties(BaseModel): time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error.", alias="timeLimit") url: StrictStr = Field(description="Target for the test.") type: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "type"] + __properties: ClassVar[List[str]] = ["collectProxyNetworkData", "followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "overrideAgentProxy", "overrideProxyId", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "type"] model_config = ConfigDict( populate_by_name=True, @@ -116,10 +119,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, "mtuMeasurements": obj.get("mtuMeasurements"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), "pathTraceMode": obj.get("pathTraceMode"), "predefinedVariables": [ApiPredefinedVariable.from_dict(_item) for _item in obj["predefinedVariables"]] if obj.get("predefinedVariables") is not None else None, "probeMode": obj.get("probeMode"), diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_test.py index b3686896f..e17e919cd 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.alert_rule import AlertRule from thousandeyes_sdk.tests.models.api_predefined_variable import ApiPredefinedVariable from thousandeyes_sdk.tests.models.api_request import ApiRequest @@ -57,10 +56,13 @@ class ApiTest(BaseModel): links: Optional[TestLinks] = Field(default=None, alias="_links") labels: Optional[List[TestLabel]] = None shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") predefined_variables: Optional[List[ApiPredefinedVariable]] = Field(default=None, alias="predefinedVariables") probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") @@ -70,12 +72,11 @@ class ApiTest(BaseModel): target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=0)]] = Field(default=None, description="Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior)", alias="targetTime") time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error.", alias="timeLimit") url: StrictStr = Field(description="Target for the test.") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") - __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "agents", "credentials", "bgpMeasurements", "usePublicBgp", "monitors"] + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "collectProxyNetworkData", "followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "overrideAgentProxy", "overrideProxyId", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "credentials", "bgpMeasurements", "usePublicBgp", "monitors"] model_config = ConfigDict( populate_by_name=True, @@ -119,7 +120,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -132,7 +132,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", "monitors", ]) @@ -179,13 +178,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['requests'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) _items = [] if self.monitors: @@ -222,10 +214,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, "mtuMeasurements": obj.get("mtuMeasurements"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), "pathTraceMode": obj.get("pathTraceMode"), "predefinedVariables": [ApiPredefinedVariable.from_dict(_item) for _item in obj["predefinedVariables"]] if obj.get("predefinedVariables") is not None else None, "probeMode": obj.get("probeMode"), @@ -235,7 +230,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "targetTime": obj.get("targetTime"), "timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30, "url": obj.get("url"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, "credentials": obj.get("credentials"), "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_test_request.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_test_request.py new file mode 100644 index 000000000..1b17679df --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_test_request.py @@ -0,0 +1,222 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.api_predefined_variable import ApiPredefinedVariable +from thousandeyes_sdk.tests.models.api_request import ApiRequest +from thousandeyes_sdk.tests.models.monitor import Monitor +from thousandeyes_sdk.tests.models.test_agent_request import TestAgentRequest +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.tests.models.test_protocol import TestProtocol +from thousandeyes_sdk.tests.models.test_ssl_version_id import TestSslVersionId +from typing import Optional, Set +from typing_extensions import Self + +class ApiTestRequest(BaseModel): + """ + ApiTestRequest + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + predefined_variables: Optional[List[ApiPredefinedVariable]] = Field(default=None, alias="predefinedVariables") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + requests: List[ApiRequest] + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=0)]] = Field(default=None, description="Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior)", alias="targetTime") + time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error.", alias="timeLimit") + url: StrictStr = Field(description="Target for the test.") + credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + agents: List[TestAgentRequest] = Field(description="Contains list of Agent IDs (get `agentId` from `/agents` endpoint).") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "collectProxyNetworkData", "followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "overrideAgentProxy", "overrideProxyId", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "credentials", "bgpMeasurements", "usePublicBgp", "monitors", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApiTestRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "monitors", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in predefined_variables (list) + _items = [] + if self.predefined_variables: + for _item in self.predefined_variables: + if _item: + _items.append(_item.to_dict()) + _dict['predefinedVariables'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in requests (list) + _items = [] + if self.requests: + for _item in self.requests: + if _item: + _items.append(_item.to_dict()) + _dict['requests'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": obj.get("alertRules"), + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), + "pathTraceMode": obj.get("pathTraceMode"), + "predefinedVariables": [ApiPredefinedVariable.from_dict(_item) for _item in obj["predefinedVariables"]] if obj.get("predefinedVariables") is not None else None, + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "requests": [ApiRequest.from_dict(_item) for _item in obj["requests"]] if obj.get("requests") is not None else None, + "sslVersionId": obj.get("sslVersionId"), + "targetTime": obj.get("targetTime"), + "timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30, + "url": obj.get("url"), + "credentials": obj.get("credentials"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None, + "agents": [TestAgentRequest.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_test_response.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_test_response.py new file mode 100644 index 000000000..ee798acd4 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/api_test_response.py @@ -0,0 +1,250 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.agent_response import AgentResponse +from thousandeyes_sdk.tests.models.alert_rule import AlertRule +from thousandeyes_sdk.tests.models.api_predefined_variable import ApiPredefinedVariable +from thousandeyes_sdk.tests.models.api_request import ApiRequest +from thousandeyes_sdk.tests.models.monitor import Monitor +from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_label import TestLabel +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.tests.models.test_protocol import TestProtocol +from thousandeyes_sdk.tests.models.test_ssl_version_id import TestSslVersionId +from typing import Optional, Set +from typing_extensions import Self + +class ApiTestResponse(BaseModel): + """ + ApiTestResponse + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + predefined_variables: Optional[List[ApiPredefinedVariable]] = Field(default=None, alias="predefinedVariables") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + requests: List[ApiRequest] + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=0)]] = Field(default=None, description="Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior)", alias="targetTime") + time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error.", alias="timeLimit") + url: StrictStr = Field(description="Target for the test.") + credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "collectProxyNetworkData", "followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "overrideAgentProxy", "overrideProxyId", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "credentials", "bgpMeasurements", "usePublicBgp", "monitors", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApiTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "monitors", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in predefined_variables (list) + _items = [] + if self.predefined_variables: + for _item in self.predefined_variables: + if _item: + _items.append(_item.to_dict()) + _dict['predefinedVariables'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in requests (list) + _items = [] + if self.requests: + for _item in self.requests: + if _item: + _items.append(_item.to_dict()) + _dict['requests'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), + "pathTraceMode": obj.get("pathTraceMode"), + "predefinedVariables": [ApiPredefinedVariable.from_dict(_item) for _item in obj["predefinedVariables"]] if obj.get("predefinedVariables") is not None else None, + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "requests": [ApiRequest.from_dict(_item) for _item in obj["requests"]] if obj.get("requests") is not None else None, + "sslVersionId": obj.get("sslVersionId"), + "targetTime": obj.get("targetTime"), + "timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30, + "url": obj.get("url"), + "credentials": obj.get("credentials"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None, + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/bgp_test_request.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/bgp_test_request.py new file mode 100644 index 000000000..431aa3e00 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/bgp_test_request.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.tests.models.test_links import TestLinks +from typing import Optional, Set +from typing_extensions import Self + +class BgpTestRequest(BaseModel): + """ + BgpTestRequest + """ # noqa: E501 + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") + include_covered_prefixes: Optional[StrictBool] = Field(default=None, description="Indicate if queries for subprefixes detected under this prefix should included.", alias="includeCoveredPrefixes") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + prefix: StrictStr = Field(description="a.b.c.d is a network address, with the prefix length defined as e. Prefixes can be any length from 8 to 24.") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "enabled", "monitors", "includeCoveredPrefixes", "usePublicBgp", "alertsEnabled", "alertRules", "prefix"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BgpTestRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BgpTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "monitors": obj.get("monitors"), + "includeCoveredPrefixes": obj.get("includeCoveredPrefixes"), + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "alertsEnabled": obj.get("alertsEnabled"), + "alertRules": obj.get("alertRules"), + "prefix": obj.get("prefix") + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/bgp_test_response.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/bgp_test_response.py new file mode 100644 index 000000000..6b923a7f3 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/bgp_test_response.py @@ -0,0 +1,184 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.tests.models.alert_rule import AlertRule +from thousandeyes_sdk.tests.models.monitor import Monitor +from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.tests.models.test_label import TestLabel +from thousandeyes_sdk.tests.models.test_links import TestLinks +from typing import Optional, Set +from typing_extensions import Self + +class BgpTestResponse(BaseModel): + """ + BgpTestResponse + """ # noqa: E501 + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + include_covered_prefixes: Optional[StrictBool] = Field(default=None, description="Indicate if queries for subprefixes detected under this prefix should included.", alias="includeCoveredPrefixes") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="A list of enabled alert rule objects.", alias="alertRules") + prefix: StrictStr = Field(description="a.b.c.d is a network address, with the prefix length defined as e. Prefixes can be any length from 8 to 24.") + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "enabled", "monitors", "includeCoveredPrefixes", "usePublicBgp", "alertsEnabled", "alertRules", "prefix"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BgpTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "monitors", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BgpTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None, + "includeCoveredPrefixes": obj.get("includeCoveredPrefixes"), + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "alertsEnabled": obj.get("alertsEnabled"), + "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "prefix": obj.get("prefix") + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_sec_instant_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_sec_instant_test.py index a10396ddc..22a5bb32b 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_sec_instant_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_sec_instant_test.py @@ -19,7 +19,6 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.dns_query_class import DnsQueryClass from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.tests.models.test_label import TestLabel @@ -46,8 +45,7 @@ class DnsSecInstantTest(BaseModel): shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "domain", "dnsQueryClass", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "domain", "dnsQueryClass"] model_config = ConfigDict( populate_by_name=True, @@ -90,7 +88,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -103,7 +100,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", ]) _dict = self.model_dump( @@ -128,13 +124,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -161,8 +150,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, "domain": obj.get("domain"), - "dnsQueryClass": obj.get("dnsQueryClass"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "dnsQueryClass": obj.get("dnsQueryClass") }) return _obj diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_sec_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_sec_test.py index 3de018fc0..2636ccd40 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_sec_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_sec_test.py @@ -19,7 +19,6 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.alert_rule import AlertRule from thousandeyes_sdk.tests.models.dns_query_class import DnsQueryClass from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount @@ -52,8 +51,7 @@ class DnsSecTest(BaseModel): shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "domain", "dnsQueryClass", "agents"] + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "domain", "dnsQueryClass"] model_config = ConfigDict( populate_by_name=True, @@ -96,7 +94,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -109,7 +106,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", ]) _dict = self.model_dump( @@ -141,13 +137,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -178,8 +167,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, "domain": obj.get("domain"), - "dnsQueryClass": obj.get("dnsQueryClass"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "dnsQueryClass": obj.get("dnsQueryClass") }) return _obj diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_sec_test_request.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_sec_test_request.py new file mode 100644 index 000000000..99ee7006c --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_sec_test_request.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.tests.models.dns_query_class import DnsQueryClass +from thousandeyes_sdk.tests.models.test_agent_request import TestAgentRequest +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_links import TestLinks +from typing import Optional, Set +from typing_extensions import Self + +class DnsSecTestRequest(BaseModel): + """ + DnsSecTestRequest + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + agents: List[TestAgentRequest] = Field(description="Contains list of Agent IDs (get `agentId` from `/agents` endpoint).") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "domain", "dnsQueryClass", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsSecTestRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DnsSecTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": obj.get("alertRules"), + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass"), + "agents": [TestAgentRequest.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_sec_test_response.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_sec_test_response.py new file mode 100644 index 000000000..8971e2f82 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_sec_test_response.py @@ -0,0 +1,184 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.tests.models.agent_response import AgentResponse +from thousandeyes_sdk.tests.models.alert_rule import AlertRule +from thousandeyes_sdk.tests.models.dns_query_class import DnsQueryClass +from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_label import TestLabel +from thousandeyes_sdk.tests.models.test_links import TestLinks +from typing import Optional, Set +from typing_extensions import Self + +class DnsSecTestResponse(BaseModel): + """ + DnsSecTestResponse + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "domain", "dnsQueryClass", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsSecTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DnsSecTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass"), + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_server_instant_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_server_instant_test.py index 1641c89fd..6aab01d74 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_server_instant_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_server_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.dns_query_class import DnsQueryClass from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.tests.models.test_dns_server import TestDnsServer @@ -65,8 +64,7 @@ class DnsServerInstantTest(BaseModel): ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "dnsServers", "dnsTransportProtocol", "domain", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "probeMode", "protocol", "recursiveQueries", "ipv6Policy", "fixedPacketRate", "dnsQueryClass", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "dnsServers", "dnsTransportProtocol", "domain", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "probeMode", "protocol", "recursiveQueries", "ipv6Policy", "fixedPacketRate", "dnsQueryClass"] model_config = ConfigDict( populate_by_name=True, @@ -109,7 +107,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -122,7 +119,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", ]) _dict = self.model_dump( @@ -154,13 +150,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['dnsServers'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -199,8 +188,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "recursiveQueries": obj.get("recursiveQueries"), "ipv6Policy": obj.get("ipv6Policy"), "fixedPacketRate": obj.get("fixedPacketRate"), - "dnsQueryClass": obj.get("dnsQueryClass"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "dnsQueryClass": obj.get("dnsQueryClass") }) return _obj diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_server_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_server_test.py index b0b91ac85..508c8c22f 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_server_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_server_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.alert_rule import AlertRule from thousandeyes_sdk.tests.models.dns_query_class import DnsQueryClass from thousandeyes_sdk.tests.models.monitor import Monitor @@ -72,11 +71,10 @@ class DnsServerTest(BaseModel): ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") - __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "dnsServers", "dnsTransportProtocol", "domain", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "probeMode", "protocol", "recursiveQueries", "ipv6Policy", "fixedPacketRate", "dnsQueryClass", "agents", "bgpMeasurements", "usePublicBgp", "monitors"] + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "dnsServers", "dnsTransportProtocol", "domain", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "probeMode", "protocol", "recursiveQueries", "ipv6Policy", "fixedPacketRate", "dnsQueryClass", "bgpMeasurements", "usePublicBgp", "monitors"] model_config = ConfigDict( populate_by_name=True, @@ -120,7 +118,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -133,7 +130,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", "monitors", ]) @@ -173,13 +169,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['dnsServers'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) _items = [] if self.monitors: @@ -230,7 +219,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "ipv6Policy": obj.get("ipv6Policy"), "fixedPacketRate": obj.get("fixedPacketRate"), "dnsQueryClass": obj.get("dnsQueryClass"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_server_test_request.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_server_test_request.py new file mode 100644 index 000000000..1f05ae956 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_server_test_request.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.dns_query_class import DnsQueryClass +from thousandeyes_sdk.tests.models.test_agent_request import TestAgentRequest +from thousandeyes_sdk.tests.models.test_dns_transport_protocol import TestDnsTransportProtocol +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_ipv6_policy import TestIpv6Policy +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.tests.models.test_protocol import TestProtocol +from typing import Optional, Set +from typing_extensions import Self + +class DnsServerTestRequest(BaseModel): + """ + DnsServerTestRequest + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + dns_servers: List[StrictStr] = Field(description="A list of DNS server FQDN.", alias="dnsServers") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + recursive_queries: Optional[StrictBool] = Field(default=None, description="Set true to run query with RD (recursion desired) flag enabled.", alias="recursiveQueries") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") + agents: List[TestAgentRequest] = Field(description="Contains list of Agent IDs (get `agentId` from `/agents` endpoint).") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "dnsServers", "dnsTransportProtocol", "domain", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "probeMode", "protocol", "recursiveQueries", "ipv6Policy", "fixedPacketRate", "dnsQueryClass", "bgpMeasurements", "usePublicBgp", "monitors", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsServerTestRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DnsServerTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": obj.get("alertRules"), + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "dnsServers": obj.get("dnsServers"), + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "recursiveQueries": obj.get("recursiveQueries"), + "ipv6Policy": obj.get("ipv6Policy"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "dnsQueryClass": obj.get("dnsQueryClass"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": obj.get("monitors"), + "agents": [TestAgentRequest.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_server_test_response.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_server_test_response.py new file mode 100644 index 000000000..d84a9dd85 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_server_test_response.py @@ -0,0 +1,238 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.agent_response import AgentResponse +from thousandeyes_sdk.tests.models.alert_rule import AlertRule +from thousandeyes_sdk.tests.models.dns_query_class import DnsQueryClass +from thousandeyes_sdk.tests.models.monitor import Monitor +from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.tests.models.test_dns_server import TestDnsServer +from thousandeyes_sdk.tests.models.test_dns_transport_protocol import TestDnsTransportProtocol +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_ipv6_policy import TestIpv6Policy +from thousandeyes_sdk.tests.models.test_label import TestLabel +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.tests.models.test_protocol import TestProtocol +from typing import Optional, Set +from typing_extensions import Self + +class DnsServerTestResponse(BaseModel): + """ + DnsServerTestResponse + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + dns_servers: List[TestDnsServer] = Field(alias="dnsServers") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + recursive_queries: Optional[StrictBool] = Field(default=None, description="Set true to run query with RD (recursion desired) flag enabled.", alias="recursiveQueries") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "dnsServers", "dnsTransportProtocol", "domain", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "probeMode", "protocol", "recursiveQueries", "ipv6Policy", "fixedPacketRate", "dnsQueryClass", "bgpMeasurements", "usePublicBgp", "monitors", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsServerTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "monitors", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in dns_servers (list) + _items = [] + if self.dns_servers: + for _item in self.dns_servers: + if _item: + _items.append(_item.to_dict()) + _dict['dnsServers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DnsServerTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "dnsServers": [TestDnsServer.from_dict(_item) for _item in obj["dnsServers"]] if obj.get("dnsServers") is not None else None, + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "recursiveQueries": obj.get("recursiveQueries"), + "ipv6Policy": obj.get("ipv6Policy"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "dnsQueryClass": obj.get("dnsQueryClass"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None, + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_trace_instant_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_trace_instant_test.py index 197da85ed..41219e5b4 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_trace_instant_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_trace_instant_test.py @@ -19,7 +19,6 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.dns_query_class import DnsQueryClass from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.tests.models.test_dns_transport_protocol import TestDnsTransportProtocol @@ -48,8 +47,7 @@ class DnsTraceInstantTest(BaseModel): dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "dnsTransportProtocol", "domain", "dnsQueryClass", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "dnsTransportProtocol", "domain", "dnsQueryClass"] model_config = ConfigDict( populate_by_name=True, @@ -92,7 +90,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -105,7 +102,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", ]) _dict = self.model_dump( @@ -130,13 +126,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -164,8 +153,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, "dnsTransportProtocol": obj.get("dnsTransportProtocol"), "domain": obj.get("domain"), - "dnsQueryClass": obj.get("dnsQueryClass"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "dnsQueryClass": obj.get("dnsQueryClass") }) return _obj diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_trace_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_trace_test.py index 655976f0a..29318fb1a 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_trace_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_trace_test.py @@ -19,7 +19,6 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.alert_rule import AlertRule from thousandeyes_sdk.tests.models.dns_query_class import DnsQueryClass from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount @@ -54,8 +53,7 @@ class DnsTraceTest(BaseModel): dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "dnsTransportProtocol", "domain", "dnsQueryClass", "agents"] + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "dnsTransportProtocol", "domain", "dnsQueryClass"] model_config = ConfigDict( populate_by_name=True, @@ -98,7 +96,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -111,7 +108,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", ]) _dict = self.model_dump( @@ -143,13 +139,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -181,8 +170,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, "dnsTransportProtocol": obj.get("dnsTransportProtocol"), "domain": obj.get("domain"), - "dnsQueryClass": obj.get("dnsQueryClass"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "dnsQueryClass": obj.get("dnsQueryClass") }) return _obj diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_trace_test_request.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_trace_test_request.py new file mode 100644 index 000000000..95a82802d --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_trace_test_request.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.tests.models.dns_query_class import DnsQueryClass +from thousandeyes_sdk.tests.models.test_agent_request import TestAgentRequest +from thousandeyes_sdk.tests.models.test_dns_transport_protocol import TestDnsTransportProtocol +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_links import TestLinks +from typing import Optional, Set +from typing_extensions import Self + +class DnsTraceTestRequest(BaseModel): + """ + DnsTraceTestRequest + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + agents: List[TestAgentRequest] = Field(description="Contains list of Agent IDs (get `agentId` from `/agents` endpoint).") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "dnsTransportProtocol", "domain", "dnsQueryClass", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsTraceTestRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DnsTraceTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": obj.get("alertRules"), + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass"), + "agents": [TestAgentRequest.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_trace_test_response.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_trace_test_response.py new file mode 100644 index 000000000..e6ca01cb5 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/dns_trace_test_response.py @@ -0,0 +1,187 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.tests.models.agent_response import AgentResponse +from thousandeyes_sdk.tests.models.alert_rule import AlertRule +from thousandeyes_sdk.tests.models.dns_query_class import DnsQueryClass +from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.tests.models.test_dns_transport_protocol import TestDnsTransportProtocol +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_label import TestLabel +from thousandeyes_sdk.tests.models.test_links import TestLinks +from typing import Optional, Set +from typing_extensions import Self + +class DnsTraceTestResponse(BaseModel): + """ + DnsTraceTestResponse + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + dns_transport_protocol: Optional[TestDnsTransportProtocol] = Field(default=None, alias="dnsTransportProtocol") + domain: StrictStr = Field(description="The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.") + dns_query_class: Optional[DnsQueryClass] = Field(default=None, alias="dnsQueryClass") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "dnsTransportProtocol", "domain", "dnsQueryClass", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsTraceTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DnsTraceTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "dnsTransportProtocol": obj.get("dnsTransportProtocol"), + "domain": obj.get("domain"), + "dnsQueryClass": obj.get("dnsQueryClass"), + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/expand_bgp_test_options.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/expand_bgp_test_options.py new file mode 100644 index 000000000..394fdd6a6 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/expand_bgp_test_options.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ExpandBgpTestOptions(str, Enum): + """ + ExpandBgpTestOptions + """ + + """ + allowed enum values + """ + ALERT_MINUS_RULE = 'alert-rule' + MONITOR = 'monitor' + LABEL = 'label' + SHARED_MINUS_WITH_MINUS_ACCOUNT = 'shared-with-account' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ExpandBgpTestOptions from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/expand_test_options.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/expand_test_options.py new file mode 100644 index 000000000..02e3addd7 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/expand_test_options.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ExpandTestOptions(str, Enum): + """ + ExpandTestOptions + """ + + """ + allowed enum values + """ + AGENT = 'agent' + ALERT_MINUS_RULE = 'alert-rule' + MONITOR = 'monitor' + LABEL = 'label' + SHARED_MINUS_WITH_MINUS_ACCOUNT = 'shared-with-account' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ExpandTestOptions from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/ftp_server_instant_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/ftp_server_instant_test.py index 872e69f13..2c19fbdad 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/ftp_server_instant_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/ftp_server_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.ftp_server_request_type import FtpServerRequestType from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.tests.models.test_ipv6_policy import TestIpv6Policy @@ -67,8 +66,7 @@ class FtpServerInstantTest(BaseModel): username: StrictStr = Field(description="Username for Basic/NTLM authentication.") fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "downloadLimit", "ftpTargetTime", "ftpTimeLimit", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "requestType", "url", "useActiveFtp", "useExplicitFtps", "username", "fixedPacketRate", "ipv6Policy", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "downloadLimit", "ftpTargetTime", "ftpTimeLimit", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "requestType", "url", "useActiveFtp", "useExplicitFtps", "username", "fixedPacketRate", "ipv6Policy"] model_config = ConfigDict( populate_by_name=True, @@ -111,7 +109,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -124,7 +121,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", ]) _dict = self.model_dump( @@ -149,13 +145,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -198,8 +187,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "useExplicitFtps": obj.get("useExplicitFtps"), "username": obj.get("username"), "fixedPacketRate": obj.get("fixedPacketRate"), - "ipv6Policy": obj.get("ipv6Policy"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "ipv6Policy": obj.get("ipv6Policy") }) return _obj diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/ftp_server_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/ftp_server_test.py index a8ed1e4e9..dc9addfdc 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/ftp_server_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/ftp_server_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.alert_rule import AlertRule from thousandeyes_sdk.tests.models.ftp_server_request_type import FtpServerRequestType from thousandeyes_sdk.tests.models.monitor import Monitor @@ -74,11 +73,10 @@ class FtpServerTest(BaseModel): username: StrictStr = Field(description="Username for Basic/NTLM authentication.") fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") - __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "downloadLimit", "ftpTargetTime", "ftpTimeLimit", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "requestType", "url", "useActiveFtp", "useExplicitFtps", "username", "fixedPacketRate", "ipv6Policy", "agents", "bgpMeasurements", "usePublicBgp", "monitors"] + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "downloadLimit", "ftpTargetTime", "ftpTimeLimit", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "requestType", "url", "useActiveFtp", "useExplicitFtps", "username", "fixedPacketRate", "ipv6Policy", "bgpMeasurements", "usePublicBgp", "monitors"] model_config = ConfigDict( populate_by_name=True, @@ -122,7 +120,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -135,7 +132,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", "monitors", ]) @@ -168,13 +164,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) _items = [] if self.monitors: @@ -229,7 +218,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "username": obj.get("username"), "fixedPacketRate": obj.get("fixedPacketRate"), "ipv6Policy": obj.get("ipv6Policy"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/ftp_server_test_request.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/ftp_server_test_request.py new file mode 100644 index 000000000..3429e4822 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/ftp_server_test_request.py @@ -0,0 +1,199 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.ftp_server_request_type import FtpServerRequestType +from thousandeyes_sdk.tests.models.test_agent_request import TestAgentRequest +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_ipv6_policy import TestIpv6Policy +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.tests.models.test_protocol import TestProtocol +from typing import Optional, Set +from typing_extensions import Self + +class FtpServerTestRequest(BaseModel): + """ + FtpServerTestRequest + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + download_limit: Optional[StrictInt] = Field(default=None, description="Specify maximum number of bytes to download from the target object.", alias="downloadLimit") + ftp_target_time: Optional[Annotated[int, Field(le=6000, strict=True, ge=1000)]] = Field(default=None, description="Target time for operation completion; specified in milliseconds.", alias="ftpTargetTime") + ftp_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=10)]] = Field(default=10, description="Set the time limit for the test in seconds.", alias="ftpTimeLimit") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: StrictStr = Field(description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + request_type: FtpServerRequestType = Field(alias="requestType") + url: StrictStr = Field(description="Target for the test.") + use_active_ftp: Optional[StrictBool] = Field(default=False, description="Explicitly set the flag to use active FTP.", alias="useActiveFtp") + use_explicit_ftps: Optional[StrictBool] = Field(default=None, description="Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS.", alias="useExplicitFtps") + username: StrictStr = Field(description="Username for Basic/NTLM authentication.") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") + agents: List[TestAgentRequest] = Field(description="Contains list of Agent IDs (get `agentId` from `/agents` endpoint).") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "downloadLimit", "ftpTargetTime", "ftpTimeLimit", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "requestType", "url", "useActiveFtp", "useExplicitFtps", "username", "fixedPacketRate", "ipv6Policy", "bgpMeasurements", "usePublicBgp", "monitors", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FtpServerTestRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FtpServerTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": obj.get("alertRules"), + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "downloadLimit": obj.get("downloadLimit"), + "ftpTargetTime": obj.get("ftpTargetTime"), + "ftpTimeLimit": obj.get("ftpTimeLimit") if obj.get("ftpTimeLimit") is not None else 10, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "requestType": obj.get("requestType"), + "url": obj.get("url"), + "useActiveFtp": obj.get("useActiveFtp") if obj.get("useActiveFtp") is not None else False, + "useExplicitFtps": obj.get("useExplicitFtps"), + "username": obj.get("username"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": obj.get("monitors"), + "agents": [TestAgentRequest.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/ftp_server_test_response.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/ftp_server_test_response.py new file mode 100644 index 000000000..89239d36e --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/ftp_server_test_response.py @@ -0,0 +1,237 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.agent_response import AgentResponse +from thousandeyes_sdk.tests.models.alert_rule import AlertRule +from thousandeyes_sdk.tests.models.ftp_server_request_type import FtpServerRequestType +from thousandeyes_sdk.tests.models.monitor import Monitor +from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_ipv6_policy import TestIpv6Policy +from thousandeyes_sdk.tests.models.test_label import TestLabel +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.tests.models.test_protocol import TestProtocol +from typing import Optional, Set +from typing_extensions import Self + +class FtpServerTestResponse(BaseModel): + """ + FtpServerTestResponse + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + download_limit: Optional[StrictInt] = Field(default=None, description="Specify maximum number of bytes to download from the target object.", alias="downloadLimit") + ftp_target_time: Optional[Annotated[int, Field(le=6000, strict=True, ge=1000)]] = Field(default=None, description="Target time for operation completion; specified in milliseconds.", alias="ftpTargetTime") + ftp_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=10)]] = Field(default=10, description="Set the time limit for the test in seconds.", alias="ftpTimeLimit") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + password: StrictStr = Field(description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + request_type: FtpServerRequestType = Field(alias="requestType") + url: StrictStr = Field(description="Target for the test.") + use_active_ftp: Optional[StrictBool] = Field(default=False, description="Explicitly set the flag to use active FTP.", alias="useActiveFtp") + use_explicit_ftps: Optional[StrictBool] = Field(default=None, description="Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS.", alias="useExplicitFtps") + username: StrictStr = Field(description="Username for Basic/NTLM authentication.") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "downloadLimit", "ftpTargetTime", "ftpTimeLimit", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "requestType", "url", "useActiveFtp", "useExplicitFtps", "username", "fixedPacketRate", "ipv6Policy", "bgpMeasurements", "usePublicBgp", "monitors", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FtpServerTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "monitors", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FtpServerTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "downloadLimit": obj.get("downloadLimit"), + "ftpTargetTime": obj.get("ftpTargetTime"), + "ftpTimeLimit": obj.get("ftpTimeLimit") if obj.get("ftpTimeLimit") is not None else 10, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "requestType": obj.get("requestType"), + "url": obj.get("url"), + "useActiveFtp": obj.get("useActiveFtp") if obj.get("useActiveFtp") is not None else False, + "useExplicitFtps": obj.get("useExplicitFtps"), + "username": obj.get("username"), + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None, + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_base_properties.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_base_properties.py index ea662674f..9778d8374 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_base_properties.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_base_properties.py @@ -40,7 +40,7 @@ class HttpServerBaseProperties(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -139,7 +139,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_instant_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_instant_test.py index b67e5d5ec..a0943190f 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_instant_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.agent_interfaces import AgentInterfaces from thousandeyes_sdk.tests.models.o_auth import OAuth from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount @@ -59,7 +58,7 @@ class HttpServerInstantTest(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -90,8 +89,7 @@ class HttpServerInstantTest(BaseModel): headers: Optional[List[StrictStr]] = Field(default=None, description="HTTP request headers used.") post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "headers", "postBody", "ipv6Policy", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "headers", "postBody", "ipv6Policy"] model_config = ConfigDict( populate_by_name=True, @@ -135,7 +133,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -149,7 +146,6 @@ def to_dict(self) -> Dict[str, Any]: "labels", "shared_with_accounts", "ssl_version", - "agents", ]) _dict = self.model_dump( @@ -183,13 +179,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of o_auth if self.o_auth: _dict['oAuth'] = self.o_auth.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -221,7 +210,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), @@ -251,8 +240,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, "headers": obj.get("headers"), "postBody": obj.get("postBody"), - "ipv6Policy": obj.get("ipv6Policy"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "ipv6Policy": obj.get("ipv6Policy") }) return _obj diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_properties.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_properties.py index ebbe46572..f54b42218 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_properties.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_properties.py @@ -41,7 +41,7 @@ class HttpServerProperties(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -146,7 +146,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_test.py index b8b4b2d2e..76f5b5103 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.agent_interfaces import AgentInterfaces from thousandeyes_sdk.tests.models.alert_rule import AlertRule from thousandeyes_sdk.tests.models.monitor import Monitor @@ -66,7 +65,7 @@ class HttpServerTest(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -97,11 +96,10 @@ class HttpServerTest(BaseModel): headers: Optional[List[StrictStr]] = Field(default=None, description="HTTP request headers used.") post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") - __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "headers", "postBody", "ipv6Policy", "agents", "bgpMeasurements", "usePublicBgp", "monitors"] + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "headers", "postBody", "ipv6Policy", "bgpMeasurements", "usePublicBgp", "monitors"] model_config = ConfigDict( populate_by_name=True, @@ -146,7 +144,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -160,7 +157,6 @@ def to_dict(self) -> Dict[str, Any]: "labels", "shared_with_accounts", "ssl_version", - "agents", "monitors", ]) @@ -202,13 +198,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of o_auth if self.o_auth: _dict['oAuth'] = self.o_auth.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) _items = [] if self.monitors: @@ -251,7 +240,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), @@ -282,7 +271,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "headers": obj.get("headers"), "postBody": obj.get("postBody"), "ipv6Policy": obj.get("ipv6Policy"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_test_request.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_test_request.py new file mode 100644 index 000000000..49d8354e7 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_test_request.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.agent_interfaces import AgentInterfaces +from thousandeyes_sdk.tests.models.o_auth import OAuth +from thousandeyes_sdk.tests.models.test_agent_request import TestAgentRequest +from thousandeyes_sdk.tests.models.test_auth_type import TestAuthType +from thousandeyes_sdk.tests.models.test_custom_headers import TestCustomHeaders +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_ipv6_policy import TestIpv6Policy +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.tests.models.test_protocol import TestProtocol +from thousandeyes_sdk.tests.models.test_ssl_version_id import TestSslVersionId +from typing import Optional, Set +from typing_extensions import Self + +class HttpServerTestRequest(BaseModel): + """ + HttpServerTestRequest + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + agent_interfaces: Optional[AgentInterfaces] = Field(default=None, alias="agentInterfaces") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") + download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") + dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + o_auth: Optional[OAuth] = Field(default=None, alias="oAuth") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + allow_unsafe_legacy_renegotiation: Optional[StrictBool] = Field(default=True, description="Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation.", alias="allowUnsafeLegacyRenegotiation") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") + headers: Optional[List[StrictStr]] = Field(default=None, description="HTTP request headers used.") + post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") + agents: List[TestAgentRequest] = Field(description="Contains list of Agent IDs (get `agentId` from `/agents` endpoint).") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "headers", "postBody", "ipv6Policy", "bgpMeasurements", "usePublicBgp", "monitors", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HttpServerTestRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "ssl_version", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of agent_interfaces + if self.agent_interfaces: + _dict['agentInterfaces'] = self.agent_interfaces.to_dict() + # override the default output from pydantic by calling `to_dict()` of custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + # override the default output from pydantic by calling `to_dict()` of o_auth + if self.o_auth: + _dict['oAuth'] = self.o_auth.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HttpServerTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": obj.get("alertRules"), + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "authType": obj.get("authType"), + "agentInterfaces": AgentInterfaces.from_dict(obj["agentInterfaces"]) if obj.get("agentInterfaces") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', + "downloadLimit": obj.get("downloadLimit"), + "dnsOverride": obj.get("dnsOverride"), + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "oAuth": OAuth.from_dict(obj["oAuth"]) if obj.get("oAuth") is not None else None, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "allowUnsafeLegacyRenegotiation": obj.get("allowUnsafeLegacyRenegotiation") if obj.get("allowUnsafeLegacyRenegotiation") is not None else True, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "fixedPacketRate": obj.get("fixedPacketRate"), + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, + "headers": obj.get("headers"), + "postBody": obj.get("postBody"), + "ipv6Policy": obj.get("ipv6Policy"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": obj.get("monitors"), + "agents": [TestAgentRequest.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_test_response.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_test_response.py new file mode 100644 index 000000000..bf2f2d6d8 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/http_server_test_response.py @@ -0,0 +1,290 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.agent_interfaces import AgentInterfaces +from thousandeyes_sdk.tests.models.agent_response import AgentResponse +from thousandeyes_sdk.tests.models.alert_rule import AlertRule +from thousandeyes_sdk.tests.models.monitor import Monitor +from thousandeyes_sdk.tests.models.o_auth import OAuth +from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.tests.models.test_auth_type import TestAuthType +from thousandeyes_sdk.tests.models.test_custom_headers import TestCustomHeaders +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_ipv6_policy import TestIpv6Policy +from thousandeyes_sdk.tests.models.test_label import TestLabel +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.tests.models.test_protocol import TestProtocol +from thousandeyes_sdk.tests.models.test_ssl_version_id import TestSslVersionId +from typing import Optional, Set +from typing_extensions import Self + +class HttpServerTestResponse(BaseModel): + """ + HttpServerTestResponse + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + agent_interfaces: Optional[AgentInterfaces] = Field(default=None, alias="agentInterfaces") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") + download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") + dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + o_auth: Optional[OAuth] = Field(default=None, alias="oAuth") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + allow_unsafe_legacy_renegotiation: Optional[StrictBool] = Field(default=True, description="Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation.", alias="allowUnsafeLegacyRenegotiation") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") + headers: Optional[List[StrictStr]] = Field(default=None, description="HTTP request headers used.") + post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "headers", "postBody", "ipv6Policy", "bgpMeasurements", "usePublicBgp", "monitors", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HttpServerTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "ssl_version", + "monitors", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of agent_interfaces + if self.agent_interfaces: + _dict['agentInterfaces'] = self.agent_interfaces.to_dict() + # override the default output from pydantic by calling `to_dict()` of custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + # override the default output from pydantic by calling `to_dict()` of o_auth + if self.o_auth: + _dict['oAuth'] = self.o_auth.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HttpServerTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "authType": obj.get("authType"), + "agentInterfaces": AgentInterfaces.from_dict(obj["agentInterfaces"]) if obj.get("agentInterfaces") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', + "downloadLimit": obj.get("downloadLimit"), + "dnsOverride": obj.get("dnsOverride"), + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "oAuth": OAuth.from_dict(obj["oAuth"]) if obj.get("oAuth") is not None else None, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "allowUnsafeLegacyRenegotiation": obj.get("allowUnsafeLegacyRenegotiation") if obj.get("allowUnsafeLegacyRenegotiation") is not None else True, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "fixedPacketRate": obj.get("fixedPacketRate"), + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, + "headers": obj.get("headers"), + "postBody": obj.get("postBody"), + "ipv6Policy": obj.get("ipv6Policy"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None, + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_instant_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_instant_test.py index ae8a08b6e..71e7063a9 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_instant_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.agent_interfaces import AgentInterfaces from thousandeyes_sdk.tests.models.o_auth import OAuth from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount @@ -59,7 +58,7 @@ class PageLoadInstantTest(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -96,8 +95,7 @@ class PageLoadInstantTest(BaseModel): allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "pageLoadTargetTime", "pageLoadTimeLimit", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "pageLoadTargetTime", "pageLoadTimeLimit", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy"] model_config = ConfigDict( populate_by_name=True, @@ -141,7 +139,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -155,7 +152,6 @@ def to_dict(self) -> Dict[str, Any]: "labels", "shared_with_accounts", "ssl_version", - "agents", ]) _dict = self.model_dump( @@ -189,13 +185,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of o_auth if self.o_auth: _dict['oAuth'] = self.o_auth.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -227,7 +216,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), @@ -263,8 +252,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, "browserLanguage": obj.get("browserLanguage"), - "pageLoadingStrategy": obj.get("pageLoadingStrategy"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "pageLoadingStrategy": obj.get("pageLoadingStrategy") }) return _obj diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_properties.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_properties.py index 0a9436227..f66ab1b1c 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_properties.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_properties.py @@ -41,7 +41,7 @@ class PageLoadProperties(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -152,7 +152,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_test.py index 20419d25e..b0def3ca7 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.agent_interfaces import AgentInterfaces from thousandeyes_sdk.tests.models.alert_rule import AlertRule from thousandeyes_sdk.tests.models.monitor import Monitor @@ -68,7 +67,7 @@ class PageLoadTest(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -105,13 +104,12 @@ class PageLoadTest(BaseModel): allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") http_interval: Optional[TestHttpInterval] = Field(default=None, alias="httpInterval") subinterval: Optional[TestSubInterval] = None - __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "pageLoadTargetTime", "pageLoadTimeLimit", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "agents", "bgpMeasurements", "usePublicBgp", "monitors", "httpInterval", "subinterval"] + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "pageLoadTargetTime", "pageLoadTimeLimit", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "bgpMeasurements", "usePublicBgp", "monitors", "httpInterval", "subinterval"] model_config = ConfigDict( populate_by_name=True, @@ -156,7 +154,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -170,7 +167,6 @@ def to_dict(self) -> Dict[str, Any]: "labels", "shared_with_accounts", "ssl_version", - "agents", "monitors", ]) @@ -212,13 +208,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of o_auth if self.o_auth: _dict['oAuth'] = self.o_auth.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) _items = [] if self.monitors: @@ -261,7 +250,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), @@ -298,7 +287,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, "browserLanguage": obj.get("browserLanguage"), "pageLoadingStrategy": obj.get("pageLoadingStrategy"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None, diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_test_request.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_test_request.py new file mode 100644 index 000000000..e96d6793e --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_test_request.py @@ -0,0 +1,270 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.agent_interfaces import AgentInterfaces +from thousandeyes_sdk.tests.models.o_auth import OAuth +from thousandeyes_sdk.tests.models.test_agent_request import TestAgentRequest +from thousandeyes_sdk.tests.models.test_auth_type import TestAuthType +from thousandeyes_sdk.tests.models.test_custom_headers import TestCustomHeaders +from thousandeyes_sdk.tests.models.test_http_interval import TestHttpInterval +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_page_loading_strategy import TestPageLoadingStrategy +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.tests.models.test_protocol import TestProtocol +from thousandeyes_sdk.tests.models.test_ssl_version_id import TestSslVersionId +from thousandeyes_sdk.tests.models.test_sub_interval import TestSubInterval +from typing import Optional, Set +from typing_extensions import Self + +class PageLoadTestRequest(BaseModel): + """ + PageLoadTestRequest + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + agent_interfaces: Optional[AgentInterfaces] = Field(default=None, alias="agentInterfaces") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") + download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") + dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + o_auth: Optional[OAuth] = Field(default=None, alias="oAuth") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + allow_unsafe_legacy_renegotiation: Optional[StrictBool] = Field(default=True, description="Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation.", alias="allowUnsafeLegacyRenegotiation") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") + emulated_device_id: Optional[StrictStr] = Field(default=None, description="ID of the emulated device, if one was given when the test was created.", alias="emulatedDeviceId") + page_load_target_time: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`.", alias="pageLoadTargetTime") + page_load_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=10, description="Page load time limit. Must be larger than the `httpTimeLimit`.", alias="pageLoadTimeLimit") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") + http_interval: Optional[TestHttpInterval] = Field(default=None, alias="httpInterval") + subinterval: Optional[TestSubInterval] = None + agents: List[TestAgentRequest] = Field(description="Contains list of Agent IDs (get `agentId` from `/agents` endpoint).") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "pageLoadTargetTime", "pageLoadTimeLimit", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "bgpMeasurements", "usePublicBgp", "monitors", "httpInterval", "subinterval", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PageLoadTestRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "ssl_version", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of agent_interfaces + if self.agent_interfaces: + _dict['agentInterfaces'] = self.agent_interfaces.to_dict() + # override the default output from pydantic by calling `to_dict()` of custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + # override the default output from pydantic by calling `to_dict()` of o_auth + if self.o_auth: + _dict['oAuth'] = self.o_auth.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PageLoadTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": obj.get("alertRules"), + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "authType": obj.get("authType"), + "agentInterfaces": AgentInterfaces.from_dict(obj["agentInterfaces"]) if obj.get("agentInterfaces") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', + "downloadLimit": obj.get("downloadLimit"), + "dnsOverride": obj.get("dnsOverride"), + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "oAuth": OAuth.from_dict(obj["oAuth"]) if obj.get("oAuth") is not None else None, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "allowUnsafeLegacyRenegotiation": obj.get("allowUnsafeLegacyRenegotiation") if obj.get("allowUnsafeLegacyRenegotiation") is not None else True, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "fixedPacketRate": obj.get("fixedPacketRate"), + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, + "emulatedDeviceId": obj.get("emulatedDeviceId"), + "pageLoadTargetTime": obj.get("pageLoadTargetTime"), + "pageLoadTimeLimit": obj.get("pageLoadTimeLimit") if obj.get("pageLoadTimeLimit") is not None else 10, + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": obj.get("monitors"), + "httpInterval": obj.get("httpInterval"), + "subinterval": obj.get("subinterval"), + "agents": [TestAgentRequest.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_test_response.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_test_response.py new file mode 100644 index 000000000..0c9bb6056 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/page_load_test_response.py @@ -0,0 +1,308 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.agent_interfaces import AgentInterfaces +from thousandeyes_sdk.tests.models.agent_response import AgentResponse +from thousandeyes_sdk.tests.models.alert_rule import AlertRule +from thousandeyes_sdk.tests.models.monitor import Monitor +from thousandeyes_sdk.tests.models.o_auth import OAuth +from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.tests.models.test_auth_type import TestAuthType +from thousandeyes_sdk.tests.models.test_custom_headers import TestCustomHeaders +from thousandeyes_sdk.tests.models.test_http_interval import TestHttpInterval +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_label import TestLabel +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_page_loading_strategy import TestPageLoadingStrategy +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.tests.models.test_protocol import TestProtocol +from thousandeyes_sdk.tests.models.test_ssl_version_id import TestSslVersionId +from thousandeyes_sdk.tests.models.test_sub_interval import TestSubInterval +from typing import Optional, Set +from typing_extensions import Self + +class PageLoadTestResponse(BaseModel): + """ + PageLoadTestResponse + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + agent_interfaces: Optional[AgentInterfaces] = Field(default=None, alias="agentInterfaces") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") + download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") + dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + o_auth: Optional[OAuth] = Field(default=None, alias="oAuth") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + allow_unsafe_legacy_renegotiation: Optional[StrictBool] = Field(default=True, description="Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation.", alias="allowUnsafeLegacyRenegotiation") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") + emulated_device_id: Optional[StrictStr] = Field(default=None, description="ID of the emulated device, if one was given when the test was created.", alias="emulatedDeviceId") + page_load_target_time: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`.", alias="pageLoadTargetTime") + page_load_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=10, description="Page load time limit. Must be larger than the `httpTimeLimit`.", alias="pageLoadTimeLimit") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + http_interval: Optional[TestHttpInterval] = Field(default=None, alias="httpInterval") + subinterval: Optional[TestSubInterval] = None + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "pageLoadTargetTime", "pageLoadTimeLimit", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "bgpMeasurements", "usePublicBgp", "monitors", "httpInterval", "subinterval", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PageLoadTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "ssl_version", + "monitors", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of agent_interfaces + if self.agent_interfaces: + _dict['agentInterfaces'] = self.agent_interfaces.to_dict() + # override the default output from pydantic by calling `to_dict()` of custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + # override the default output from pydantic by calling `to_dict()` of o_auth + if self.o_auth: + _dict['oAuth'] = self.o_auth.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PageLoadTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "authType": obj.get("authType"), + "agentInterfaces": AgentInterfaces.from_dict(obj["agentInterfaces"]) if obj.get("agentInterfaces") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', + "downloadLimit": obj.get("downloadLimit"), + "dnsOverride": obj.get("dnsOverride"), + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "oAuth": OAuth.from_dict(obj["oAuth"]) if obj.get("oAuth") is not None else None, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "allowUnsafeLegacyRenegotiation": obj.get("allowUnsafeLegacyRenegotiation") if obj.get("allowUnsafeLegacyRenegotiation") is not None else True, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "fixedPacketRate": obj.get("fixedPacketRate"), + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, + "emulatedDeviceId": obj.get("emulatedDeviceId"), + "pageLoadTargetTime": obj.get("pageLoadTargetTime"), + "pageLoadTimeLimit": obj.get("pageLoadTimeLimit") if obj.get("pageLoadTimeLimit") is not None else 10, + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None, + "httpInterval": obj.get("httpInterval"), + "subinterval": obj.get("subinterval"), + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/sip_server_instant_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/sip_server_instant_test.py index 4f4b63f12..23390ae70 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/sip_server_instant_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/sip_server_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.tests.models.test_ipv6_policy import TestIpv6Policy from thousandeyes_sdk.tests.models.test_label import TestLabel @@ -58,8 +57,7 @@ class SipServerInstantTest(BaseModel): sip_time_limit: Optional[Annotated[int, Field(le=10, strict=True, ge=5)]] = Field(default=5, description="Time limit in milliseconds.", alias="sipTimeLimit") fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "mtuMeasurements", "networkMeasurements", "numPathTraces", "optionsRegex", "pathTraceMode", "probeMode", "registerEnabled", "sipTargetTime", "sipTimeLimit", "fixedPacketRate", "ipv6Policy", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "mtuMeasurements", "networkMeasurements", "numPathTraces", "optionsRegex", "pathTraceMode", "probeMode", "registerEnabled", "sipTargetTime", "sipTimeLimit", "fixedPacketRate", "ipv6Policy"] model_config = ConfigDict( populate_by_name=True, @@ -102,7 +100,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -115,7 +112,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", ]) _dict = self.model_dump( @@ -140,13 +136,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -182,8 +171,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "sipTargetTime": obj.get("sipTargetTime"), "sipTimeLimit": obj.get("sipTimeLimit") if obj.get("sipTimeLimit") is not None else 5, "fixedPacketRate": obj.get("fixedPacketRate"), - "ipv6Policy": obj.get("ipv6Policy"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "ipv6Policy": obj.get("ipv6Policy") }) return _obj diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/sip_server_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/sip_server_test.py index 14e02e869..cff88e8e0 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/sip_server_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/sip_server_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.alert_rule import AlertRule from thousandeyes_sdk.tests.models.monitor import Monitor from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount @@ -42,6 +41,9 @@ class SipServerTest(BaseModel): alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") description: Optional[StrictStr] = Field(default=None, description="A description of the test.") @@ -66,17 +68,13 @@ class SipServerTest(BaseModel): sip_time_limit: Optional[Annotated[int, Field(le=10, strict=True, ge=5)]] = Field(default=5, description="Time limit in milliseconds.", alias="sipTimeLimit") fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") auth_user: Optional[StrictStr] = Field(default=None, description="Username for authentication with SIP server.", alias="authUser") password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") port: Annotated[int, Field(le=65535, strict=True, ge=1)] = Field(description="Target port.") protocol: Optional[SipTestProtocol] = None sip_registrar: Optional[StrictStr] = Field(default=None, description="SIP server to be tested, specified by domain name or IP address.", alias="sipRegistrar") user: Optional[StrictStr] = Field(default=None, description="Username for SIP registration, should be unique within a ThousandEyes account group.") - bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") - use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") - monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") - __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "mtuMeasurements", "networkMeasurements", "numPathTraces", "optionsRegex", "pathTraceMode", "probeMode", "registerEnabled", "sipTargetTime", "sipTimeLimit", "fixedPacketRate", "ipv6Policy", "agents", "authUser", "password", "port", "protocol", "sipRegistrar", "user", "bgpMeasurements", "usePublicBgp", "monitors"] + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "bgpMeasurements", "usePublicBgp", "monitors", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "mtuMeasurements", "networkMeasurements", "numPathTraces", "optionsRegex", "pathTraceMode", "probeMode", "registerEnabled", "sipTargetTime", "sipTimeLimit", "fixedPacketRate", "ipv6Policy", "authUser", "password", "port", "protocol", "sipRegistrar", "user"] model_config = ConfigDict( populate_by_name=True, @@ -120,9 +118,9 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ + "monitors", "created_by", "created_date", "live_share", @@ -133,8 +131,6 @@ def to_dict(self) -> Dict[str, Any]: "type", "labels", "shared_with_accounts", - "agents", - "monitors", ]) _dict = self.model_dump( @@ -149,6 +145,13 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items # override the default output from pydantic by calling `to_dict()` of links if self.links: _dict['_links'] = self.links.to_dict() @@ -166,20 +169,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) - _items = [] - if self.monitors: - for _item in self.monitors: - if _item: - _items.append(_item.to_dict()) - _dict['monitors'] = _items return _dict @classmethod @@ -196,6 +185,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "alertsEnabled": obj.get("alertsEnabled"), "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None, "createdBy": obj.get("createdBy"), "createdDate": obj.get("createdDate"), "description": obj.get("description"), @@ -220,16 +212,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "sipTimeLimit": obj.get("sipTimeLimit") if obj.get("sipTimeLimit") is not None else 5, "fixedPacketRate": obj.get("fixedPacketRate"), "ipv6Policy": obj.get("ipv6Policy"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, "authUser": obj.get("authUser"), "password": obj.get("password"), "port": obj.get("port") if obj.get("port") is not None else 49153, "protocol": obj.get("protocol"), "sipRegistrar": obj.get("sipRegistrar"), - "user": obj.get("user"), - "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, - "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, - "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None + "user": obj.get("user") }) return _obj diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/sip_server_test_request.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/sip_server_test_request.py new file mode 100644 index 000000000..364138708 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/sip_server_test_request.py @@ -0,0 +1,199 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.monitor import Monitor +from thousandeyes_sdk.tests.models.test_agent_request import TestAgentRequest +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_ipv6_policy import TestIpv6Policy +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.tests.models.test_sip_credentials import TestSipCredentials +from typing import Optional, Set +from typing_extensions import Self + +class SipServerTestRequest(BaseModel): + """ + SipServerTestRequest + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + options_regex: Optional[StrictStr] = Field(default=None, description="Options regex, this field does not require escaping.", alias="optionsRegex") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + register_enabled: Optional[StrictBool] = Field(default=False, description="Set to true to perform SIP registration on the test target with the SIP REGISTER command.", alias="registerEnabled") + sip_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for test completion in milliseconds.", alias="sipTargetTime") + sip_time_limit: Optional[Annotated[int, Field(le=10, strict=True, ge=5)]] = Field(default=5, description="Time limit in milliseconds.", alias="sipTimeLimit") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + target_sip_credentials: TestSipCredentials = Field(alias="targetSipCredentials") + agents: List[TestAgentRequest] = Field(description="Contains list of Agent IDs (get `agentId` from `/agents` endpoint).") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "mtuMeasurements", "networkMeasurements", "numPathTraces", "optionsRegex", "pathTraceMode", "probeMode", "registerEnabled", "sipTargetTime", "sipTimeLimit", "fixedPacketRate", "ipv6Policy", "bgpMeasurements", "usePublicBgp", "monitors", "targetSipCredentials", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SipServerTestRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "monitors", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + # override the default output from pydantic by calling `to_dict()` of target_sip_credentials + if self.target_sip_credentials: + _dict['targetSipCredentials'] = self.target_sip_credentials.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SipServerTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": obj.get("alertRules"), + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "optionsRegex": obj.get("optionsRegex"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "registerEnabled": obj.get("registerEnabled") if obj.get("registerEnabled") is not None else False, + "sipTargetTime": obj.get("sipTargetTime"), + "sipTimeLimit": obj.get("sipTimeLimit") if obj.get("sipTimeLimit") is not None else 5, + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None, + "targetSipCredentials": TestSipCredentials.from_dict(obj["targetSipCredentials"]) if obj.get("targetSipCredentials") is not None else None, + "agents": [TestAgentRequest.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/sip_server_test_response.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/sip_server_test_response.py new file mode 100644 index 000000000..a4d879755 --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/sip_server_test_response.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.agent_response import AgentResponse +from thousandeyes_sdk.tests.models.alert_rule import AlertRule +from thousandeyes_sdk.tests.models.monitor import Monitor +from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.tests.models.sip_test_protocol import SipTestProtocol +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_ipv6_policy import TestIpv6Policy +from thousandeyes_sdk.tests.models.test_label import TestLabel +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.tests.models.test_probe_mode import TestProbeMode +from typing import Optional, Set +from typing_extensions import Self + +class SipServerTestResponse(BaseModel): + """ + SipServerTestResponse + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + options_regex: Optional[StrictStr] = Field(default=None, description="Options regex, this field does not require escaping.", alias="optionsRegex") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + register_enabled: Optional[StrictBool] = Field(default=False, description="Set to true to perform SIP registration on the test target with the SIP REGISTER command.", alias="registerEnabled") + sip_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for test completion in milliseconds.", alias="sipTargetTime") + sip_time_limit: Optional[Annotated[int, Field(le=10, strict=True, ge=5)]] = Field(default=5, description="Time limit in milliseconds.", alias="sipTimeLimit") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") + auth_user: Optional[StrictStr] = Field(default=None, description="Username for authentication with SIP server.", alias="authUser") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + port: Annotated[int, Field(le=65535, strict=True, ge=1)] = Field(description="Target port.") + protocol: Optional[SipTestProtocol] = None + sip_registrar: Optional[StrictStr] = Field(default=None, description="SIP server to be tested, specified by domain name or IP address.", alias="sipRegistrar") + user: Optional[StrictStr] = Field(default=None, description="Username for SIP registration, should be unique within a ThousandEyes account group.") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "bgpMeasurements", "usePublicBgp", "monitors", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "mtuMeasurements", "networkMeasurements", "numPathTraces", "optionsRegex", "pathTraceMode", "probeMode", "registerEnabled", "sipTargetTime", "sipTimeLimit", "fixedPacketRate", "ipv6Policy", "authUser", "password", "port", "protocol", "sipRegistrar", "user", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SipServerTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "monitors", + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SipServerTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None, + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "optionsRegex": obj.get("optionsRegex"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "registerEnabled": obj.get("registerEnabled") if obj.get("registerEnabled") is not None else False, + "sipTargetTime": obj.get("sipTargetTime"), + "sipTimeLimit": obj.get("sipTimeLimit") if obj.get("sipTimeLimit") is not None else 5, + "fixedPacketRate": obj.get("fixedPacketRate"), + "ipv6Policy": obj.get("ipv6Policy"), + "authUser": obj.get("authUser"), + "password": obj.get("password"), + "port": obj.get("port") if obj.get("port") is not None else 49153, + "protocol": obj.get("protocol"), + "sipRegistrar": obj.get("sipRegistrar"), + "user": obj.get("user"), + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/test_agent_request.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/test_agent_request.py new file mode 100644 index 000000000..ee061f99c --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/test_agent_request.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TestAgentRequest(BaseModel): + """ + TestAgentRequest + """ # noqa: E501 + agent_id: StrictStr = Field(description="The agent ID. Get `agentId` from `/agents` endpoint.", alias="agentId") + source_ip_address: Optional[StrictStr] = Field(default=None, description="The IP address from the `ipAddresses` field in agent details, used for interface selection. Get `ipAddresses` from the `/agents` endpoint.", alias="sourceIpAddress") + __properties: ClassVar[List[str]] = ["agentId", "sourceIpAddress"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TestAgentRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TestAgentRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "sourceIpAddress": obj.get("sourceIpAddress") + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/test_request.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/test_request.py index 040866b5d..0ed1b3052 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/test_request.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/test_request.py @@ -18,7 +18,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.tests.models.agent_request import AgentRequest +from thousandeyes_sdk.tests.models.test_agent_request import TestAgentRequest from typing import Optional, Set from typing_extensions import Self @@ -29,7 +29,7 @@ class TestRequest(BaseModel): labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") - agents: Optional[List[AgentRequest]] = None + agents: List[TestAgentRequest] = Field(description="Contains list of Agent IDs (get `agentId` from `/agents` endpoint).") __properties: ClassVar[List[str]] = ["labels", "sharedWithAccounts", "alertRules", "agents"] model_config = ConfigDict( @@ -94,7 +94,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "labels": obj.get("labels"), "sharedWithAccounts": obj.get("sharedWithAccounts"), "alertRules": obj.get("alertRules"), - "agents": [AgentRequest.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "agents": [TestAgentRequest.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None }) return _obj diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/unexpanded_api_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/unexpanded_api_test.py index 15f7766ad..2197e5e0a 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/unexpanded_api_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/unexpanded_api_test.py @@ -49,10 +49,13 @@ class UnexpandedApiTest(BaseModel): test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") type: Optional[StrictStr] = None links: Optional[TestLinks] = Field(default=None, alias="_links") + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") predefined_variables: Optional[List[ApiPredefinedVariable]] = Field(default=None, alias="predefinedVariables") probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") @@ -64,7 +67,7 @@ class UnexpandedApiTest(BaseModel): url: StrictStr = Field(description="Target for the test.") bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") - __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "bgpMeasurements", "usePublicBgp"] + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "collectProxyNetworkData", "followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "overrideAgentProxy", "overrideProxyId", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "bgpMeasurements", "usePublicBgp"] model_config = ConfigDict( populate_by_name=True, @@ -165,10 +168,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "testName": obj.get("testName"), "type": obj.get("type"), "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, "mtuMeasurements": obj.get("mtuMeasurements"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), "pathTraceMode": obj.get("pathTraceMode"), "predefinedVariables": [ApiPredefinedVariable.from_dict(_item) for _item in obj["predefinedVariables"]] if obj.get("predefinedVariables") is not None else None, "probeMode": obj.get("probeMode"), diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/unexpanded_http_server_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/unexpanded_http_server_test.py index 579f883d6..c3e2e2003 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/unexpanded_http_server_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/unexpanded_http_server_test.py @@ -58,7 +58,7 @@ class UnexpandedHttpServerTest(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -195,7 +195,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/unexpanded_page_load_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/unexpanded_page_load_test.py index 711519de7..e6976a383 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/unexpanded_page_load_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/unexpanded_page_load_test.py @@ -60,7 +60,7 @@ class UnexpandedPageLoadTest(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -205,7 +205,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/unexpanded_web_transaction_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/unexpanded_web_transaction_test.py index 0499aa545..f3c1d3a54 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/unexpanded_web_transaction_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/unexpanded_web_transaction_test.py @@ -59,7 +59,7 @@ class UnexpandedWebTransactionTest(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -204,7 +204,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/update_sip_server_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/update_sip_server_test.py index 7f235bae8..a2195f9a4 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/update_sip_server_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/update_sip_server_test.py @@ -20,10 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent_request import AgentRequest +from thousandeyes_sdk.tests.models.alert_rule import AlertRule from thousandeyes_sdk.tests.models.monitor import Monitor +from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.tests.models.test_interval import TestInterval from thousandeyes_sdk.tests.models.test_ipv6_policy import TestIpv6Policy +from thousandeyes_sdk.tests.models.test_label import TestLabel from thousandeyes_sdk.tests.models.test_links import TestLinks from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode from thousandeyes_sdk.tests.models.test_probe_mode import TestProbeMode @@ -38,7 +40,7 @@ class UpdateSipServerTest(BaseModel): interval: TestInterval alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") - alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") description: Optional[StrictStr] = Field(default=None, description="A description of the test.") @@ -50,8 +52,8 @@ class UpdateSipServerTest(BaseModel): test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") type: Optional[StrictStr] = None links: Optional[TestLinks] = Field(default=None, alias="_links") - labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") - shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") @@ -63,12 +65,11 @@ class UpdateSipServerTest(BaseModel): sip_time_limit: Optional[Annotated[int, Field(le=10, strict=True, ge=5)]] = Field(default=5, description="Time limit in milliseconds.", alias="sipTimeLimit") fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy") - agents: Optional[List[AgentRequest]] = None - target_sip_credentials: TestSipCredentials = Field(alias="targetSipCredentials") bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") - __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "mtuMeasurements", "networkMeasurements", "numPathTraces", "optionsRegex", "pathTraceMode", "probeMode", "registerEnabled", "sipTargetTime", "sipTimeLimit", "fixedPacketRate", "ipv6Policy", "agents", "targetSipCredentials", "bgpMeasurements", "usePublicBgp", "monitors"] + target_sip_credentials: TestSipCredentials = Field(alias="targetSipCredentials") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "mtuMeasurements", "networkMeasurements", "numPathTraces", "optionsRegex", "pathTraceMode", "probeMode", "registerEnabled", "sipTargetTime", "sipTimeLimit", "fixedPacketRate", "ipv6Policy", "bgpMeasurements", "usePublicBgp", "monitors", "targetSipCredentials"] model_config = ConfigDict( populate_by_name=True, @@ -110,6 +111,8 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -120,6 +123,8 @@ def to_dict(self) -> Dict[str, Any]: "saved_event", "test_id", "type", + "labels", + "shared_with_accounts", "monitors", ]) @@ -128,19 +133,30 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items # override the default output from pydantic by calling `to_dict()` of links if self.links: _dict['_links'] = self.links.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) _items = [] - if self.agents: - for _item in self.agents: + if self.labels: + for _item in self.labels: if _item: _items.append(_item.to_dict()) - _dict['agents'] = _items - # override the default output from pydantic by calling `to_dict()` of target_sip_credentials - if self.target_sip_credentials: - _dict['targetSipCredentials'] = self.target_sip_credentials.to_dict() + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) _items = [] if self.monitors: @@ -148,6 +164,9 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['monitors'] = _items + # override the default output from pydantic by calling `to_dict()` of target_sip_credentials + if self.target_sip_credentials: + _dict['targetSipCredentials'] = self.target_sip_credentials.to_dict() return _dict @classmethod @@ -163,7 +182,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "interval": obj.get("interval"), "alertsEnabled": obj.get("alertsEnabled"), "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, - "alertRules": obj.get("alertRules"), + "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, "createdBy": obj.get("createdBy"), "createdDate": obj.get("createdDate"), "description": obj.get("description"), @@ -175,8 +194,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "testName": obj.get("testName"), "type": obj.get("type"), "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, - "labels": obj.get("labels"), - "sharedWithAccounts": obj.get("sharedWithAccounts"), + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, "mtuMeasurements": obj.get("mtuMeasurements"), "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, @@ -188,11 +207,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "sipTimeLimit": obj.get("sipTimeLimit") if obj.get("sipTimeLimit") is not None else 5, "fixedPacketRate": obj.get("fixedPacketRate"), "ipv6Policy": obj.get("ipv6Policy"), - "agents": [AgentRequest.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, - "targetSipCredentials": TestSipCredentials.from_dict(obj["targetSipCredentials"]) if obj.get("targetSipCredentials") is not None else None, "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, - "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None + "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None, + "targetSipCredentials": TestSipCredentials.from_dict(obj["targetSipCredentials"]) if obj.get("targetSipCredentials") is not None else None }) return _obj diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/voice_instant_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/voice_instant_test.py index a4252485e..97f3452e2 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/voice_instant_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/voice_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount from thousandeyes_sdk.tests.models.test_dscp_id import TestDscpId from thousandeyes_sdk.tests.models.test_label import TestLabel @@ -54,8 +53,7 @@ class VoiceInstantTest(BaseModel): num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1024)]] = Field(default=None, description="Port number for the chosen protocol.") target_agent_id: StrictStr = Field(description="Agent ID of the target agent for the test.", alias="targetAgentId") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId", "agents"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId"] model_config = ConfigDict( populate_by_name=True, @@ -100,7 +98,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -115,7 +112,6 @@ def to_dict(self) -> Dict[str, Any]: "shared_with_accounts", "codec", "dscp", - "agents", ]) _dict = self.model_dump( @@ -140,13 +136,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -180,8 +169,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "jitterBuffer": obj.get("jitterBuffer") if obj.get("jitterBuffer") is not None else 40, "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, "port": obj.get("port"), - "targetAgentId": obj.get("targetAgentId"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "targetAgentId": obj.get("targetAgentId") }) return _obj diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/voice_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/voice_test.py index 246040b6e..99f95d52a 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/voice_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/voice_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.alert_rule import AlertRule from thousandeyes_sdk.tests.models.monitor import Monitor from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount @@ -61,11 +60,10 @@ class VoiceTest(BaseModel): num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1024)]] = Field(default=None, description="Port number for the chosen protocol.") target_agent_id: StrictStr = Field(description="Agent ID of the target agent for the test.", alias="targetAgentId") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") - __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId", "agents", "bgpMeasurements", "usePublicBgp", "monitors"] + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId", "bgpMeasurements", "usePublicBgp", "monitors"] model_config = ConfigDict( populate_by_name=True, @@ -111,7 +109,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -126,7 +123,6 @@ def to_dict(self) -> Dict[str, Any]: "shared_with_accounts", "codec", "dscp", - "agents", "monitors", ]) @@ -159,13 +155,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sharedWithAccounts'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) _items = [] if self.monitors: @@ -211,7 +200,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, "port": obj.get("port"), "targetAgentId": obj.get("targetAgentId"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/voice_test_request.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/voice_test_request.py new file mode 100644 index 000000000..c22bc361f --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/voice_test_request.py @@ -0,0 +1,191 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.monitor import Monitor +from thousandeyes_sdk.tests.models.test_agent_request import TestAgentRequest +from thousandeyes_sdk.tests.models.test_dscp_id import TestDscpId +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_links import TestLinks +from typing import Optional, Set +from typing_extensions import Self + +class VoiceTestRequest(BaseModel): + """ + VoiceTestRequest + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + codec: Optional[StrictStr] = Field(default=None, description="Codec label") + codec_id: Optional[StrictStr] = Field(default=None, description="Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab)", alias="codecId") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + duration: Optional[Annotated[int, Field(le=30, strict=True, ge=5)]] = Field(default=5, description="Duration of the test in seconds.") + jitter_buffer: Optional[Annotated[int, Field(le=150, strict=True, ge=0)]] = Field(default=40, description="De-jitter buffer size in seconds.", alias="jitterBuffer") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1024)]] = Field(default=None, description="Port number for the chosen protocol.") + target_agent_id: StrictStr = Field(description="Agent ID of the target agent for the test.", alias="targetAgentId") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + agents: List[TestAgentRequest] = Field(description="Contains list of Agent IDs (get `agentId` from `/agents` endpoint).") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId", "bgpMeasurements", "usePublicBgp", "monitors", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of VoiceTestRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "codec", + "dscp", + "monitors", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VoiceTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": obj.get("alertRules"), + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "codec": obj.get("codec"), + "codecId": obj.get("codecId"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "duration": obj.get("duration") if obj.get("duration") is not None else 5, + "jitterBuffer": obj.get("jitterBuffer") if obj.get("jitterBuffer") is not None else 40, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "port": obj.get("port"), + "targetAgentId": obj.get("targetAgentId"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None, + "agents": [TestAgentRequest.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/voice_test_response.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/voice_test_response.py new file mode 100644 index 000000000..6a247ceca --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/voice_test_response.py @@ -0,0 +1,219 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.agent_response import AgentResponse +from thousandeyes_sdk.tests.models.alert_rule import AlertRule +from thousandeyes_sdk.tests.models.monitor import Monitor +from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.tests.models.test_dscp_id import TestDscpId +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_label import TestLabel +from thousandeyes_sdk.tests.models.test_links import TestLinks +from typing import Optional, Set +from typing_extensions import Self + +class VoiceTestResponse(BaseModel): + """ + VoiceTestResponse + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + codec: Optional[StrictStr] = Field(default=None, description="Codec label") + codec_id: Optional[StrictStr] = Field(default=None, description="Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab)", alias="codecId") + dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.") + dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId") + duration: Optional[Annotated[int, Field(le=30, strict=True, ge=5)]] = Field(default=5, description="Duration of the test in seconds.") + jitter_buffer: Optional[Annotated[int, Field(le=150, strict=True, ge=0)]] = Field(default=40, description="De-jitter buffer size in seconds.", alias="jitterBuffer") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1024)]] = Field(default=None, description="Port number for the chosen protocol.") + target_agent_id: StrictStr = Field(description="Agent ID of the target agent for the test.", alias="targetAgentId") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId", "bgpMeasurements", "usePublicBgp", "monitors", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of VoiceTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "codec", + "dscp", + "monitors", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VoiceTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "codec": obj.get("codec"), + "codecId": obj.get("codecId"), + "dscp": obj.get("dscp"), + "dscpId": obj.get("dscpId"), + "duration": obj.get("duration") if obj.get("duration") is not None else 5, + "jitterBuffer": obj.get("jitterBuffer") if obj.get("jitterBuffer") is not None else 40, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "port": obj.get("port"), + "targetAgentId": obj.get("targetAgentId"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None, + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_instant_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_instant_test.py index b0aefadbe..9325145d1 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_instant_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_instant_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.agent_interfaces import AgentInterfaces from thousandeyes_sdk.tests.models.o_auth import OAuth from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount @@ -59,7 +58,7 @@ class WebTransactionInstantTest(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -97,9 +96,8 @@ class WebTransactionInstantTest(BaseModel): allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") - __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "targetTime", "timeLimit", "transactionScript", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "agents", "credentials"] + __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "targetTime", "timeLimit", "transactionScript", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "credentials"] model_config = ConfigDict( populate_by_name=True, @@ -143,7 +141,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -157,7 +154,6 @@ def to_dict(self) -> Dict[str, Any]: "labels", "shared_with_accounts", "ssl_version", - "agents", ]) _dict = self.model_dump( @@ -191,13 +187,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of o_auth if self.o_auth: _dict['oAuth'] = self.o_auth.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items return _dict @classmethod @@ -229,7 +218,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), @@ -267,7 +256,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, "browserLanguage": obj.get("browserLanguage"), "pageLoadingStrategy": obj.get("pageLoadingStrategy"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, "credentials": obj.get("credentials") }) return _obj diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_properties.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_properties.py index 4bd3cbcdc..23553b980 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_properties.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_properties.py @@ -41,7 +41,7 @@ class WebTransactionProperties(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -153,7 +153,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_test.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_test.py index 629b74103..18a883c61 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_test.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_test.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from thousandeyes_sdk.tests.models.agent import Agent from thousandeyes_sdk.tests.models.agent_interfaces import AgentInterfaces from thousandeyes_sdk.tests.models.alert_rule import AlertRule from thousandeyes_sdk.tests.models.monitor import Monitor @@ -67,7 +66,7 @@ class WebTransactionTest(BaseModel): client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") - desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") @@ -105,13 +104,12 @@ class WebTransactionTest(BaseModel): allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") - agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.") credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") subinterval: Optional[TestSubInterval] = None - __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "targetTime", "timeLimit", "transactionScript", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "agents", "credentials", "bgpMeasurements", "usePublicBgp", "monitors", "subinterval"] + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "targetTime", "timeLimit", "transactionScript", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "credentials", "bgpMeasurements", "usePublicBgp", "monitors", "subinterval"] model_config = ConfigDict( populate_by_name=True, @@ -156,7 +154,6 @@ def to_dict(self) -> Dict[str, Any]: * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. - * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "created_by", @@ -170,7 +167,6 @@ def to_dict(self) -> Dict[str, Any]: "labels", "shared_with_accounts", "ssl_version", - "agents", "monitors", ]) @@ -212,13 +208,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of o_auth if self.o_auth: _dict['oAuth'] = self.o_auth.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in agents (list) - _items = [] - if self.agents: - for _item in self.agents: - if _item: - _items.append(_item.to_dict()) - _dict['agents'] = _items # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) _items = [] if self.monitors: @@ -261,7 +250,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientCertificate": obj.get("clientCertificate"), "contentRegex": obj.get("contentRegex"), "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, - "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200', + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', "downloadLimit": obj.get("downloadLimit"), "dnsOverride": obj.get("dnsOverride"), "httpTargetTime": obj.get("httpTargetTime"), @@ -299,7 +288,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, "browserLanguage": obj.get("browserLanguage"), "pageLoadingStrategy": obj.get("pageLoadingStrategy"), - "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, "credentials": obj.get("credentials"), "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_test_request.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_test_request.py new file mode 100644 index 000000000..716451a7a --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_test_request.py @@ -0,0 +1,271 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.agent_interfaces import AgentInterfaces +from thousandeyes_sdk.tests.models.o_auth import OAuth +from thousandeyes_sdk.tests.models.test_agent_request import TestAgentRequest +from thousandeyes_sdk.tests.models.test_auth_type import TestAuthType +from thousandeyes_sdk.tests.models.test_custom_headers import TestCustomHeaders +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_page_loading_strategy import TestPageLoadingStrategy +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.tests.models.test_protocol import TestProtocol +from thousandeyes_sdk.tests.models.test_ssl_version_id import TestSslVersionId +from thousandeyes_sdk.tests.models.test_sub_interval import TestSubInterval +from typing import Optional, Set +from typing_extensions import Self + +class WebTransactionTestRequest(BaseModel): + """ + WebTransactionTestRequest + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[StrictStr]] = Field(default=None, description="List of alert rules IDs to apply to the test (get `ruleId` from `/alerts/rules` endpoint. If `alertsEnabled` is set to `true` and `alertRules` is not included on test creation or update, applicable user default alert rules will be used)", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test label IDs (get `labelId` from `/labels` endpoint)") + shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", alias="sharedWithAccounts") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + agent_interfaces: Optional[AgentInterfaces] = Field(default=None, alias="agentInterfaces") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") + download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") + dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + o_auth: Optional[OAuth] = Field(default=None, alias="oAuth") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + allow_unsafe_legacy_renegotiation: Optional[StrictBool] = Field(default=True, description="Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation.", alias="allowUnsafeLegacyRenegotiation") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") + emulated_device_id: Optional[StrictStr] = Field(default=None, description="ID of the emulated device, if specified when the test was created.", alias="emulatedDeviceId") + target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=0)]] = Field(default=None, description="Target completion time. The default is 50% of the specified time limit in seconds. (Set to 0 to use the default behavior).", alias="targetTime") + time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds.", alias="timeLimit") + transaction_script: StrictStr = Field(description="JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ).", alias="transactionScript") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") + subinterval: Optional[TestSubInterval] = None + agents: List[TestAgentRequest] = Field(description="Contains list of Agent IDs (get `agentId` from `/agents` endpoint).") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "targetTime", "timeLimit", "transactionScript", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "credentials", "bgpMeasurements", "usePublicBgp", "monitors", "subinterval", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebTransactionTestRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "ssl_version", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of agent_interfaces + if self.agent_interfaces: + _dict['agentInterfaces'] = self.agent_interfaces.to_dict() + # override the default output from pydantic by calling `to_dict()` of custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + # override the default output from pydantic by calling `to_dict()` of o_auth + if self.o_auth: + _dict['oAuth'] = self.o_auth.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebTransactionTestRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": obj.get("alertRules"), + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": obj.get("labels"), + "sharedWithAccounts": obj.get("sharedWithAccounts"), + "authType": obj.get("authType"), + "agentInterfaces": AgentInterfaces.from_dict(obj["agentInterfaces"]) if obj.get("agentInterfaces") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', + "downloadLimit": obj.get("downloadLimit"), + "dnsOverride": obj.get("dnsOverride"), + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "oAuth": OAuth.from_dict(obj["oAuth"]) if obj.get("oAuth") is not None else None, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "allowUnsafeLegacyRenegotiation": obj.get("allowUnsafeLegacyRenegotiation") if obj.get("allowUnsafeLegacyRenegotiation") is not None else True, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "fixedPacketRate": obj.get("fixedPacketRate"), + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, + "emulatedDeviceId": obj.get("emulatedDeviceId"), + "targetTime": obj.get("targetTime"), + "timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30, + "transactionScript": obj.get("transactionScript"), + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "credentials": obj.get("credentials"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": obj.get("monitors"), + "subinterval": obj.get("subinterval"), + "agents": [TestAgentRequest.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_test_response.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_test_response.py new file mode 100644 index 000000000..c6a28030c --- /dev/null +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/web_transaction_test_response.py @@ -0,0 +1,309 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.tests.models.agent_interfaces import AgentInterfaces +from thousandeyes_sdk.tests.models.agent_response import AgentResponse +from thousandeyes_sdk.tests.models.alert_rule import AlertRule +from thousandeyes_sdk.tests.models.monitor import Monitor +from thousandeyes_sdk.tests.models.o_auth import OAuth +from thousandeyes_sdk.tests.models.shared_with_account import SharedWithAccount +from thousandeyes_sdk.tests.models.test_auth_type import TestAuthType +from thousandeyes_sdk.tests.models.test_custom_headers import TestCustomHeaders +from thousandeyes_sdk.tests.models.test_interval import TestInterval +from thousandeyes_sdk.tests.models.test_label import TestLabel +from thousandeyes_sdk.tests.models.test_links import TestLinks +from thousandeyes_sdk.tests.models.test_page_loading_strategy import TestPageLoadingStrategy +from thousandeyes_sdk.tests.models.test_path_trace_mode import TestPathTraceMode +from thousandeyes_sdk.tests.models.test_probe_mode import TestProbeMode +from thousandeyes_sdk.tests.models.test_protocol import TestProtocol +from thousandeyes_sdk.tests.models.test_ssl_version_id import TestSslVersionId +from thousandeyes_sdk.tests.models.test_sub_interval import TestSubInterval +from typing import Optional, Set +from typing_extensions import Self + +class WebTransactionTestResponse(BaseModel): + """ + WebTransactionTestResponse + """ # noqa: E501 + interval: TestInterval + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + alert_rules: Optional[List[AlertRule]] = Field(default=None, description="Contains list of enabled alert rule objects.", alias="alertRules") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[StrictStr] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + labels: Optional[List[TestLabel]] = None + shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts") + auth_type: Optional[TestAuthType] = Field(default=None, alias="authType") + agent_interfaces: Optional[AgentInterfaces] = Field(default=None, alias="agentInterfaces") + bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements") + client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate") + content_regex: Optional[StrictStr] = Field(default=None, description="Content regex, this field does not require escaping.", alias="contentRegex") + custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders") + desired_status_code: Optional[StrictStr] = Field(default='default', description="Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.", alias="desiredStatusCode") + download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit") + dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride") + http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime") + http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit") + http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion") + include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders") + mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements") + network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements") + num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces") + o_auth: Optional[OAuth] = Field(default=None, alias="oAuth") + password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.") + path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode") + probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode") + protocol: Optional[TestProtocol] = None + ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion") + ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId") + url: StrictStr = Field(description="Target for the test.") + use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm") + user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent") + username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.") + verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate") + allow_unsafe_legacy_renegotiation: Optional[StrictBool] = Field(default=True, description="Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation.", alias="allowUnsafeLegacyRenegotiation") + follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects") + fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate") + override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy") + override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId") + collect_proxy_network_data: Optional[StrictBool] = Field(default=False, description="Indicates whether network data to the proxy should be collected.", alias="collectProxyNetworkData") + emulated_device_id: Optional[StrictStr] = Field(default=None, description="ID of the emulated device, if specified when the test was created.", alias="emulatedDeviceId") + target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=0)]] = Field(default=None, description="Target completion time. The default is 50% of the specified time limit in seconds. (Set to 0 to use the default behavior).", alias="targetTime") + time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds.", alias="timeLimit") + transaction_script: StrictStr = Field(description="JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ).", alias="transactionScript") + block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains") + disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot") + allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera") + allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation") + browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage") + page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy") + credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).") + bgp_measurements: Optional[StrictBool] = Field(default=True, description="Set to `true` to enable bgp measurements.", alias="bgpMeasurements") + use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") + monitors: Optional[List[Monitor]] = Field(default=None, description="Contains list of enabled BGP monitors.") + subinterval: Optional[TestSubInterval] = None + agents: Optional[List[AgentResponse]] = Field(default=None, description="Contains list of agents.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "agentInterfaces", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "oAuth", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "collectProxyNetworkData", "emulatedDeviceId", "targetTime", "timeLimit", "transactionScript", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "credentials", "bgpMeasurements", "usePublicBgp", "monitors", "subinterval", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebTransactionTestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "type", + "labels", + "shared_with_accounts", + "ssl_version", + "monitors", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules (list) + _items = [] + if self.alert_rules: + for _item in self.alert_rules: + if _item: + _items.append(_item.to_dict()) + _dict['alertRules'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in labels (list) + _items = [] + if self.labels: + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) + _dict['labels'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list) + _items = [] + if self.shared_with_accounts: + for _item in self.shared_with_accounts: + if _item: + _items.append(_item.to_dict()) + _dict['sharedWithAccounts'] = _items + # override the default output from pydantic by calling `to_dict()` of agent_interfaces + if self.agent_interfaces: + _dict['agentInterfaces'] = self.agent_interfaces.to_dict() + # override the default output from pydantic by calling `to_dict()` of custom_headers + if self.custom_headers: + _dict['customHeaders'] = self.custom_headers.to_dict() + # override the default output from pydantic by calling `to_dict()` of o_auth + if self.o_auth: + _dict['oAuth'] = self.o_auth.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in monitors (list) + _items = [] + if self.monitors: + for _item in self.monitors: + if _item: + _items.append(_item.to_dict()) + _dict['monitors'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebTransactionTestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "alertRules": [AlertRule.from_dict(_item) for _item in obj["alertRules"]] if obj.get("alertRules") is not None else None, + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None, + "authType": obj.get("authType"), + "agentInterfaces": AgentInterfaces.from_dict(obj["agentInterfaces"]) if obj.get("agentInterfaces") is not None else None, + "bandwidthMeasurements": obj.get("bandwidthMeasurements"), + "clientCertificate": obj.get("clientCertificate"), + "contentRegex": obj.get("contentRegex"), + "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None, + "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else 'default', + "downloadLimit": obj.get("downloadLimit"), + "dnsOverride": obj.get("dnsOverride"), + "httpTargetTime": obj.get("httpTargetTime"), + "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5, + "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2, + "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True, + "mtuMeasurements": obj.get("mtuMeasurements"), + "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True, + "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3, + "oAuth": OAuth.from_dict(obj["oAuth"]) if obj.get("oAuth") is not None else None, + "password": obj.get("password"), + "pathTraceMode": obj.get("pathTraceMode"), + "probeMode": obj.get("probeMode"), + "protocol": obj.get("protocol"), + "sslVersion": obj.get("sslVersion"), + "sslVersionId": obj.get("sslVersionId"), + "url": obj.get("url"), + "useNtlm": obj.get("useNtlm"), + "userAgent": obj.get("userAgent"), + "username": obj.get("username"), + "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False, + "allowUnsafeLegacyRenegotiation": obj.get("allowUnsafeLegacyRenegotiation") if obj.get("allowUnsafeLegacyRenegotiation") is not None else True, + "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True, + "fixedPacketRate": obj.get("fixedPacketRate"), + "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False, + "overrideProxyId": obj.get("overrideProxyId"), + "collectProxyNetworkData": obj.get("collectProxyNetworkData") if obj.get("collectProxyNetworkData") is not None else False, + "emulatedDeviceId": obj.get("emulatedDeviceId"), + "targetTime": obj.get("targetTime"), + "timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30, + "transactionScript": obj.get("transactionScript"), + "blockDomains": obj.get("blockDomains"), + "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False, + "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False, + "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False, + "browserLanguage": obj.get("browserLanguage"), + "pageLoadingStrategy": obj.get("pageLoadingStrategy"), + "credentials": obj.get("credentials"), + "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, + "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, + "monitors": [Monitor.from_dict(_item) for _item in obj["monitors"]] if obj.get("monitors") is not None else None, + "subinterval": obj.get("subinterval"), + "agents": [AgentResponse.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-tests/test/test_agent_to_agent_tests_api.py b/thousandeyes-sdk-tests/test/test_agent_to_agent_tests_api.py new file mode 100644 index 000000000..619467760 --- /dev/null +++ b/thousandeyes-sdk-tests/test/test_agent_to_agent_tests_api.py @@ -0,0 +1,702 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.tests.api.agent_to_agent_tests_api import AgentToAgentTestsApi + + +class TestAgentToAgentTestsApi(unittest.TestCase): + """AgentToAgentTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = AgentToAgentTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_agent_to_agent_test_models_validation(self) -> None: + """Test case for create_agent_to_agent_test request and response models""" + request_body_json = """ + { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ "344753", "212697" ], + "description" : "ThousandEyes Test", + "type" : "agent-to-agent", + "mss" : 100, + "usePublicBgp" : true, + "enabled" : true, + "dscpId" : "0", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "throughputRate" : 10, + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "direction" : "to-target", + "throughputMeasurements" : false, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "throughputDuration" : 10000, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "2954", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "monitors" : [ "17410", "5" ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.AgentToAgentTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "type" : "agent-to-agent", + "mss" : 100, + "usePublicBgp" : true, + "enabled" : true, + "dscpId" : "0", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "throughputRate" : 10, + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "direction" : "to-target", + "throughputMeasurements" : false, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "throughputDuration" : 10000, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "2954", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.AgentToAgentTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_agent_to_agent_test_models_validation(self) -> None: + """Test case for delete_agent_to_agent_test request and response models""" + + + def test_get_agent_to_agent_test_models_validation(self) -> None: + """Test case for get_agent_to_agent_test request and response models""" + + response_body_json = """ + { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "type" : "agent-to-agent", + "mss" : 100, + "usePublicBgp" : true, + "enabled" : true, + "dscpId" : "0", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "throughputRate" : 10, + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "direction" : "to-target", + "throughputMeasurements" : false, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "throughputDuration" : 10000, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "2954", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.AgentToAgentTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_agent_to_agent_tests_models_validation(self) -> None: + """Test case for get_agent_to_agent_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "description" : "ThousandEyes Test", + "type" : "agent-to-agent", + "mss" : 100, + "usePublicBgp" : true, + "enabled" : true, + "dscpId" : "0", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "throughputRate" : 10, + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "direction" : "to-target", + "throughputMeasurements" : false, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "throughputDuration" : 10000, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "2954", + "interval" : 60, + "testId" : "281474976710706" + }, { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "description" : "ThousandEyes Test", + "type" : "agent-to-agent", + "mss" : 100, + "usePublicBgp" : true, + "enabled" : true, + "dscpId" : "0", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "throughputRate" : 10, + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "direction" : "to-target", + "throughputMeasurements" : false, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "throughputDuration" : 10000, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "2954", + "interval" : 60, + "testId" : "281474976710706" + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.AgentToAgentTests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_agent_to_agent_test_models_validation(self) -> None: + """Test case for update_agent_to_agent_test request and response models""" + request_body_json = """ + { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ "344753", "212697" ], + "description" : "ThousandEyes Test", + "type" : "agent-to-agent", + "mss" : 100, + "usePublicBgp" : true, + "enabled" : true, + "dscpId" : "0", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "throughputRate" : 10, + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "direction" : "to-target", + "throughputMeasurements" : false, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "throughputDuration" : 10000, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "2954", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "monitors" : [ "17410", "5" ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.AgentToAgentTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "type" : "agent-to-agent", + "mss" : 100, + "usePublicBgp" : true, + "enabled" : true, + "dscpId" : "0", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "throughputRate" : 10, + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "direction" : "to-target", + "throughputMeasurements" : false, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "throughputDuration" : 10000, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "2954", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.AgentToAgentTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-tests/test/test_agent_to_server_tests_api.py b/thousandeyes-sdk-tests/test/test_agent_to_server_tests_api.py new file mode 100644 index 000000000..662341924 --- /dev/null +++ b/thousandeyes-sdk-tests/test/test_agent_to_server_tests_api.py @@ -0,0 +1,716 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.tests.api.agent_to_server_tests_api import AgentToServerTestsApi + + +class TestAgentToServerTestsApi(unittest.TestCase): + """AgentToServerTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = AgentToServerTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_agent_to_server_test_models_validation(self) -> None: + """Test case for create_agent_to_server_test request and response models""" + request_body_json = """ + { + "server" : "www.thousandeyes.com", + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ "344753", "212697" ], + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "agent-to-server", + "usePublicBgp" : true, + "enabled" : true, + "dscpId" : "0", + "fixedPacketRate" : 25, + "protocol" : "tcp", + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : false, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "pingPayloadSize" : 112, + "continuousMode" : false, + "monitors" : [ "17410", "5" ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.AgentToServerTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "server" : "www.thousandeyes.com", + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "agent-to-server", + "usePublicBgp" : true, + "enabled" : true, + "dscpId" : "0", + "fixedPacketRate" : 25, + "protocol" : "tcp", + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : false, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "pingPayloadSize" : 112, + "continuousMode" : false, + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.AgentToServerTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_agent_to_server_test_models_validation(self) -> None: + """Test case for delete_agent_to_server_test request and response models""" + + + def test_get_agent_to_server_test_models_validation(self) -> None: + """Test case for get_agent_to_server_test request and response models""" + + response_body_json = """ + { + "server" : "www.thousandeyes.com", + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "agent-to-server", + "usePublicBgp" : true, + "enabled" : true, + "dscpId" : "0", + "fixedPacketRate" : 25, + "protocol" : "tcp", + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : false, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "pingPayloadSize" : 112, + "continuousMode" : false, + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.AgentToServerTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_agent_to_server_tests_models_validation(self) -> None: + """Test case for get_agent_to_server_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "server" : "www.thousandeyes.com", + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "agent-to-server", + "usePublicBgp" : true, + "enabled" : true, + "dscpId" : "0", + "fixedPacketRate" : 25, + "protocol" : "tcp", + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : false, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "pingPayloadSize" : 112, + "continuousMode" : false + }, { + "server" : "www.thousandeyes.com", + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "agent-to-server", + "usePublicBgp" : true, + "enabled" : true, + "dscpId" : "0", + "fixedPacketRate" : 25, + "protocol" : "tcp", + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : false, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "pingPayloadSize" : 112, + "continuousMode" : false + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.AgentToServerTests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_agent_to_server_test_models_validation(self) -> None: + """Test case for update_agent_to_server_test request and response models""" + request_body_json = """ + { + "server" : "www.thousandeyes.com", + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ "344753", "212697" ], + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "agent-to-server", + "usePublicBgp" : true, + "enabled" : true, + "dscpId" : "0", + "fixedPacketRate" : 25, + "protocol" : "tcp", + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : false, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "pingPayloadSize" : 112, + "continuousMode" : false, + "monitors" : [ "17410", "5" ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.AgentToServerTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "server" : "www.thousandeyes.com", + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "agent-to-server", + "usePublicBgp" : true, + "enabled" : true, + "dscpId" : "0", + "fixedPacketRate" : 25, + "protocol" : "tcp", + "dscp" : "Best Effort (DSCP 0)", + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : false, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "pingPayloadSize" : 112, + "continuousMode" : false, + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.AgentToServerTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-tests/test/test_api_tests_api.py b/thousandeyes-sdk-tests/test/test_api_tests_api.py new file mode 100644 index 000000000..3a2880943 --- /dev/null +++ b/thousandeyes-sdk-tests/test/test_api_tests_api.py @@ -0,0 +1,1274 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.tests.api.api_tests_api import APITestsApi + + +class TestAPITestsApi(unittest.TestCase): + """APITestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = APITestsApi() + + def tearDown(self) -> None: + pass + + def test_create_api_test_models_validation(self) -> None: + """Test case for create_api_test request and response models""" + request_body_json = """ + { + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "credentials" : [ "3247", "1051" ], + "alertRules" : [ "344753", "212697" ], + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "requests" : [ { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + }, { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + } ], + "type" : "api", + "usePublicBgp" : true, + "enabled" : true, + "protocol" : "tcp", + "collectProxyNetworkData" : false, + "followRedirects" : true, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "overrideAgentProxy" : false, + "predefinedVariables" : [ { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + }, { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + } ], + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "timeLimit" : 19, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "overrideProxyId" : "281474976710706", + "sslVersionId" : "0", + "targetTime" : 1, + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.ApiTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "credentials" : [ "3247", "1051" ], + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "requests" : [ { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + }, { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + } ], + "type" : "api", + "usePublicBgp" : true, + "enabled" : true, + "protocol" : "tcp", + "collectProxyNetworkData" : false, + "followRedirects" : true, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "overrideAgentProxy" : false, + "predefinedVariables" : [ { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + }, { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + } ], + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "timeLimit" : 19, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "overrideProxyId" : "281474976710706", + "sslVersionId" : "0", + "targetTime" : 1, + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.ApiTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_api_test_models_validation(self) -> None: + """Test case for delete_api_test request and response models""" + + + def test_get_api_test_models_validation(self) -> None: + """Test case for get_api_test request and response models""" + + response_body_json = """ + { + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "credentials" : [ "3247", "1051" ], + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "requests" : [ { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + }, { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + } ], + "type" : "api", + "usePublicBgp" : true, + "enabled" : true, + "protocol" : "tcp", + "collectProxyNetworkData" : false, + "followRedirects" : true, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "overrideAgentProxy" : false, + "predefinedVariables" : [ { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + }, { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + } ], + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "timeLimit" : 19, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "overrideProxyId" : "281474976710706", + "sslVersionId" : "0", + "targetTime" : 1, + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.ApiTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_api_tests_models_validation(self) -> None: + """Test case for get_api_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "requests" : [ { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + }, { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + } ], + "type" : "api", + "usePublicBgp" : true, + "enabled" : true, + "protocol" : "tcp", + "collectProxyNetworkData" : false, + "followRedirects" : true, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "overrideAgentProxy" : false, + "predefinedVariables" : [ { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + }, { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + } ], + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "timeLimit" : 19, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "overrideProxyId" : "281474976710706", + "sslVersionId" : "0", + "targetTime" : 1 + }, { + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "requests" : [ { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + }, { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + } ], + "type" : "api", + "usePublicBgp" : true, + "enabled" : true, + "protocol" : "tcp", + "collectProxyNetworkData" : false, + "followRedirects" : true, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "overrideAgentProxy" : false, + "predefinedVariables" : [ { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + }, { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + } ], + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "timeLimit" : 19, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "overrideProxyId" : "281474976710706", + "sslVersionId" : "0", + "targetTime" : 1 + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.ApiTests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_api_test_models_validation(self) -> None: + """Test case for update_api_test request and response models""" + request_body_json = """ + { + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "credentials" : [ "3247", "1051" ], + "alertRules" : [ "344753", "212697" ], + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "requests" : [ { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + }, { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + } ], + "type" : "api", + "usePublicBgp" : true, + "enabled" : true, + "protocol" : "tcp", + "collectProxyNetworkData" : false, + "followRedirects" : true, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "overrideAgentProxy" : false, + "predefinedVariables" : [ { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + }, { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + } ], + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "timeLimit" : 19, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "overrideProxyId" : "281474976710706", + "sslVersionId" : "0", + "targetTime" : 1, + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.ApiTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "credentials" : [ "3247", "1051" ], + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "requests" : [ { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + }, { + "headers" : [ { + "value" : "keep-alive", + "key" : "x-custom-header" + }, { + "value" : "keep-alive", + "key" : "x-custom-header" + } ], + "variables" : [ { + "name" : "myTestName", + "value" : "tests[0].name" + }, { + "name" : "myTestName", + "value" : "tests[0].name" + } ], + "method" : "get", + "body" : "body", + "url" : "https://api.thousandeyes.com/v7/status", + "password" : "basic_pw123", + "bearerToken" : "abcd-1234-...", + "name" : "Step 1", + "waitTimeMs" : 0, + "assertions" : [ { + "name" : "status-code", + "value" : "200", + "operator" : "is" + }, { + "name" : "status-code", + "value" : "200", + "operator" : "is" + } ], + "authType" : "none", + "collectApiResponse" : true, + "username" : "ThousandEyesUserName" + } ], + "type" : "api", + "usePublicBgp" : true, + "enabled" : true, + "protocol" : "tcp", + "collectProxyNetworkData" : false, + "followRedirects" : true, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "overrideAgentProxy" : false, + "predefinedVariables" : [ { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + }, { + "name" : "myUsername", + "value" : "ThousandEyesAccountUserName" + } ], + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "timeLimit" : 19, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "overrideProxyId" : "281474976710706", + "sslVersionId" : "0", + "targetTime" : 1, + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.ApiTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-tests/test/test_bgp_tests_api.py b/thousandeyes-sdk-tests/test/test_bgp_tests_api.py new file mode 100644 index 000000000..9c2bf802e --- /dev/null +++ b/thousandeyes-sdk-tests/test/test_bgp_tests_api.py @@ -0,0 +1,521 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.tests.api.bgp_tests_api import BGPTestsApi + + +class TestBGPTestsApi(unittest.TestCase): + """BGPTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = BGPTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_bgp_test_models_validation(self) -> None: + """Test case for create_bgp_test request and response models""" + request_body_json = """ + { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "prefix" : "prefix", + "savedEvent" : true, + "includeCoveredPrefixes" : true, + "alertRules" : [ "344753", "212697" ], + "description" : "ThousandEyes Test", + "type" : "bgp", + "usePublicBgp" : true, + "enabled" : true, + "labels" : [ "9842", "1283" ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "monitors" : [ "17410", "5" ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.BgpTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "prefix" : "prefix", + "savedEvent" : true, + "includeCoveredPrefixes" : true, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "type" : "bgp", + "usePublicBgp" : true, + "enabled" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.BgpTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_bgp_test_models_validation(self) -> None: + """Test case for delete_bgp_test request and response models""" + + + def test_get_bgp_test_models_validation(self) -> None: + """Test case for get_bgp_test request and response models""" + + response_body_json = """ + { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "prefix" : "prefix", + "savedEvent" : true, + "includeCoveredPrefixes" : true, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "type" : "bgp", + "usePublicBgp" : true, + "enabled" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.BgpTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_bgp_tests_models_validation(self) -> None: + """Test case for get_bgp_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "prefix" : "prefix", + "savedEvent" : true, + "includeCoveredPrefixes" : true, + "description" : "ThousandEyes Test", + "type" : "bgp", + "usePublicBgp" : true, + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "prefix" : "prefix", + "savedEvent" : true, + "includeCoveredPrefixes" : true, + "description" : "ThousandEyes Test", + "type" : "bgp", + "usePublicBgp" : true, + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.BgpTests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_bgp_test_models_validation(self) -> None: + """Test case for update_bgp_test request and response models""" + request_body_json = """ + { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "includeCoveredPrefixes" : true, + "alertRules" : [ "344753", "212697" ], + "description" : "ThousandEyes Test", + "type" : "bgp", + "usePublicBgp" : true, + "enabled" : true, + "labels" : [ "9842", "1283" ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "monitors" : [ "17410", "5" ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.UpdateBgpTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "prefix" : "prefix", + "savedEvent" : true, + "includeCoveredPrefixes" : true, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "type" : "bgp", + "usePublicBgp" : true, + "enabled" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.BgpTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-tests/test/test_dns_server_tests_api.py b/thousandeyes-sdk-tests/test/test_dns_server_tests_api.py new file mode 100644 index 000000000..9bc26bee6 --- /dev/null +++ b/thousandeyes-sdk-tests/test/test_dns_server_tests_api.py @@ -0,0 +1,739 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.tests.api.dns_server_tests_api import DNSServerTestsApi + + +class TestDNSServerTestsApi(unittest.TestCase): + """DNSServerTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSServerTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_dns_server_test_models_validation(self) -> None: + """Test case for create_dns_server_test request and response models""" + request_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ "344753", "212697" ], + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "probeMode" : "auto", + "type" : "dns-server", + "usePublicBgp" : true, + "enabled" : true, + "protocol" : "tcp", + "fixedPacketRate" : 50, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "dnsServers" : [ "dns-example.net", "8.8.8.8" ], + "alertsEnabled" : true, + "recursiveQueries" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "dnsQueryClass" : "in", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "monitors" : [ "17410", "5" ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.DnsServerTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "probeMode" : "auto", + "type" : "dns-server", + "usePublicBgp" : true, + "enabled" : true, + "protocol" : "tcp", + "fixedPacketRate" : 50, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "dnsServers" : [ { + "serverName" : "dns-example.net", + "serverId" : "1447" + }, { + "serverName" : "dns-example.net", + "serverId" : "1447" + } ], + "alertsEnabled" : true, + "recursiveQueries" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "dnsQueryClass" : "in", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.DnsServerTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_dns_server_test_models_validation(self) -> None: + """Test case for delete_dns_server_test request and response models""" + + + def test_get_dns_server_test_models_validation(self) -> None: + """Test case for get_dns_server_test request and response models""" + + response_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "probeMode" : "auto", + "type" : "dns-server", + "usePublicBgp" : true, + "enabled" : true, + "protocol" : "tcp", + "fixedPacketRate" : 50, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "dnsServers" : [ { + "serverName" : "dns-example.net", + "serverId" : "1447" + }, { + "serverName" : "dns-example.net", + "serverId" : "1447" + } ], + "alertsEnabled" : true, + "recursiveQueries" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "dnsQueryClass" : "in", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.DnsServerTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_dns_server_tests_models_validation(self) -> None: + """Test case for get_dns_server_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "probeMode" : "auto", + "type" : "dns-server", + "usePublicBgp" : true, + "enabled" : true, + "protocol" : "tcp", + "fixedPacketRate" : 50, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "dnsServers" : [ { + "serverName" : "dns-example.net", + "serverId" : "1447" + }, { + "serverName" : "dns-example.net", + "serverId" : "1447" + } ], + "alertsEnabled" : true, + "recursiveQueries" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "dnsQueryClass" : "in", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706" + }, { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "probeMode" : "auto", + "type" : "dns-server", + "usePublicBgp" : true, + "enabled" : true, + "protocol" : "tcp", + "fixedPacketRate" : 50, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "dnsServers" : [ { + "serverName" : "dns-example.net", + "serverId" : "1447" + }, { + "serverName" : "dns-example.net", + "serverId" : "1447" + } ], + "alertsEnabled" : true, + "recursiveQueries" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "dnsQueryClass" : "in", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706" + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.DnsServerTests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_dns_server_test_models_validation(self) -> None: + """Test case for update_dns_server_test request and response models""" + request_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ "344753", "212697" ], + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "probeMode" : "auto", + "type" : "dns-server", + "usePublicBgp" : true, + "enabled" : true, + "protocol" : "tcp", + "fixedPacketRate" : 50, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "dnsServers" : [ "dns-example.net", "8.8.8.8" ], + "alertsEnabled" : true, + "recursiveQueries" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "dnsQueryClass" : "in", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "monitors" : [ "17410", "5" ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.DnsServerTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "probeMode" : "auto", + "type" : "dns-server", + "usePublicBgp" : true, + "enabled" : true, + "protocol" : "tcp", + "fixedPacketRate" : 50, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "dnsServers" : [ { + "serverName" : "dns-example.net", + "serverId" : "1447" + }, { + "serverName" : "dns-example.net", + "serverId" : "1447" + } ], + "alertsEnabled" : true, + "recursiveQueries" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "dnsQueryClass" : "in", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.DnsServerTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-tests/test/test_dns_trace_tests_api.py b/thousandeyes-sdk-tests/test/test_dns_trace_tests_api.py new file mode 100644 index 000000000..ff99d888b --- /dev/null +++ b/thousandeyes-sdk-tests/test/test_dns_trace_tests_api.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.tests.api.dns_trace_tests_api import DNSTraceTestsApi + + +class TestDNSTraceTestsApi(unittest.TestCase): + """DNSTraceTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSTraceTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_dns_trace_test_models_validation(self) -> None: + """Test case for create_dns_trace_test request and response models""" + request_body_json = """ + { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "alertRules" : [ "344753", "212697" ], + "savedEvent" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "type" : "dns-trace", + "enabled" : true, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.DnsTraceTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "savedEvent" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "type" : "dns-trace", + "enabled" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.DnsTraceTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_dns_trace_test_models_validation(self) -> None: + """Test case for delete_dns_trace_test request and response models""" + + + def test_get_dns_trace_test_models_validation(self) -> None: + """Test case for get_dns_trace_test request and response models""" + + response_body_json = """ + { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "savedEvent" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "type" : "dns-trace", + "enabled" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.DnsTraceTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_dns_trace_tests_models_validation(self) -> None: + """Test case for get_dns_trace_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "type" : "dns-trace", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "type" : "dns-trace", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.DnsTraceTests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_dns_trace_test_models_validation(self) -> None: + """Test case for update_dns_trace_test request and response models""" + request_body_json = """ + { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "alertRules" : [ "344753", "212697" ], + "savedEvent" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "type" : "dns-trace", + "enabled" : true, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.DnsTraceTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "savedEvent" : true, + "description" : "ThousandEyes Test", + "dnsTransportProtocol" : "udp", + "type" : "dns-trace", + "enabled" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.DnsTraceTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-tests/test/test_dnssec_tests_api.py b/thousandeyes-sdk-tests/test/test_dnssec_tests_api.py new file mode 100644 index 000000000..633f76b89 --- /dev/null +++ b/thousandeyes-sdk-tests/test/test_dnssec_tests_api.py @@ -0,0 +1,564 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.tests.api.dnssec_tests_api import DNSSECTestsApi + + +class TestDNSSECTestsApi(unittest.TestCase): + """DNSSECTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = DNSSECTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_dns_sec_test_models_validation(self) -> None: + """Test case for create_dns_sec_test request and response models""" + request_body_json = """ + { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "alertRules" : [ "344753", "212697" ], + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "dnssec", + "enabled" : true, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.DnsSecTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "dnssec", + "enabled" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.DnsSecTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_dns_sec_test_models_validation(self) -> None: + """Test case for delete_dns_sec_test request and response models""" + + + def test_get_dns_sec_test_models_validation(self) -> None: + """Test case for get_dns_sec_test request and response models""" + + response_body_json = """ + { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "dnssec", + "enabled" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.DnsSecTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_dns_sec_tests_models_validation(self) -> None: + """Test case for get_dns_sec_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "dnssec", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "dnssec", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.DnsSecTests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_dns_sec_test_models_validation(self) -> None: + """Test case for update_dns_sec_test request and response models""" + request_body_json = """ + { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "alertRules" : [ "344753", "212697" ], + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "dnssec", + "enabled" : true, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.DnsSecTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "dnsQueryClass" : "in", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "dnssec", + "enabled" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "domain" : "www.thousandeyes.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.DnsSecTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-tests/test/test_ftp_server_tests_api.py b/thousandeyes-sdk-tests/test/test_ftp_server_tests_api.py new file mode 100644 index 000000000..22c166d8b --- /dev/null +++ b/thousandeyes-sdk-tests/test/test_ftp_server_tests_api.py @@ -0,0 +1,737 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.tests.api.ftp_server_tests_api import FTPServerTestsApi + + +class TestFTPServerTestsApi(unittest.TestCase): + """FTPServerTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = FTPServerTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_ftp_server_test_models_validation(self) -> None: + """Test case for create_ftp_server_test request and response models""" + request_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "downloadLimit" : 1048576, + "alertRules" : [ "344753", "212697" ], + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "useExplicitFtps" : false, + "probeMode" : "auto", + "type" : "ftp-server", + "usePublicBgp" : true, + "enabled" : true, + "password" : "password", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "ftpTargetTime" : 1400, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "requestType" : "download", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "ftpTimeLimit" : 10, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "useActiveFtp" : false, + "username" : "username", + "monitors" : [ "17410", "5" ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.FtpServerTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "downloadLimit" : 1048576, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "useExplicitFtps" : false, + "probeMode" : "auto", + "type" : "ftp-server", + "usePublicBgp" : true, + "enabled" : true, + "password" : "password", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "ftpTargetTime" : 1400, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "requestType" : "download", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "ftpTimeLimit" : 10, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "useActiveFtp" : false, + "username" : "username", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.FtpServerTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_ftp_server_test_models_validation(self) -> None: + """Test case for delete_ftp_server_test request and response models""" + + + def test_get_ftp_server_test_models_validation(self) -> None: + """Test case for get_ftp_server_test request and response models""" + + response_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "downloadLimit" : 1048576, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "useExplicitFtps" : false, + "probeMode" : "auto", + "type" : "ftp-server", + "usePublicBgp" : true, + "enabled" : true, + "password" : "password", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "ftpTargetTime" : 1400, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "requestType" : "download", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "ftpTimeLimit" : 10, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "useActiveFtp" : false, + "username" : "username", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.FtpServerTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_ftp_server_tests_models_validation(self) -> None: + """Test case for get_ftp_server_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "downloadLimit" : 1048576, + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "useExplicitFtps" : false, + "probeMode" : "auto", + "type" : "ftp-server", + "usePublicBgp" : true, + "enabled" : true, + "password" : "password", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "ftpTargetTime" : 1400, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "requestType" : "download", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "ftpTimeLimit" : 10, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "useActiveFtp" : false, + "username" : "username" + }, { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "downloadLimit" : 1048576, + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "useExplicitFtps" : false, + "probeMode" : "auto", + "type" : "ftp-server", + "usePublicBgp" : true, + "enabled" : true, + "password" : "password", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "ftpTargetTime" : 1400, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "requestType" : "download", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "ftpTimeLimit" : 10, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "useActiveFtp" : false, + "username" : "username" + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.FtpServerTests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_ftp_server_test_models_validation(self) -> None: + """Test case for update_ftp_server_test request and response models""" + request_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "downloadLimit" : 1048576, + "alertRules" : [ "344753", "212697" ], + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "useExplicitFtps" : false, + "probeMode" : "auto", + "type" : "ftp-server", + "usePublicBgp" : true, + "enabled" : true, + "password" : "password", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "ftpTargetTime" : 1400, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "requestType" : "download", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "ftpTimeLimit" : 10, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "useActiveFtp" : false, + "username" : "username", + "monitors" : [ "17410", "5" ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.FtpServerTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "downloadLimit" : 1048576, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "bandwidthMeasurements" : true, + "description" : "ThousandEyes Test", + "useExplicitFtps" : false, + "probeMode" : "auto", + "type" : "ftp-server", + "usePublicBgp" : true, + "enabled" : true, + "password" : "password", + "protocol" : "tcp", + "fixedPacketRate" : 50, + "ftpTargetTime" : 1400, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "requestType" : "download", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "ftpTimeLimit" : 10, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "useActiveFtp" : false, + "username" : "username", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.FtpServerTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-tests/test/test_http_server_tests_api.py b/thousandeyes-sdk-tests/test/test_http_server_tests_api.py new file mode 100644 index 000000000..251f4e04d --- /dev/null +++ b/thousandeyes-sdk-tests/test/test_http_server_tests_api.py @@ -0,0 +1,1038 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.tests.api.http_server_tests_api import HTTPServerTestsApi + + +class TestHTTPServerTestsApi(unittest.TestCase): + """HTTPServerTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = HTTPServerTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_http_server_test_models_validation(self) -> None: + """Test case for create_http_server_test request and response models""" + request_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "http-server", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "testName" : "ThousandEyes Test", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ "9842", "1283" ], + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "sharedWithAccounts" : [ "1234", "12345" ], + "overrideProxyId" : "281474976710706", + "monitors" : [ "17410", "5" ], + "sslVersion" : "Auto", + "useNtlm" : false, + "ipv6Policy" : "use-agent-policy", + "downloadLimit" : 2048, + "alertRules" : [ "344753", "212697" ], + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "usePublicBgp" : true, + "enabled" : true, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "headers" : [ "header1: value1", "header2: value2" ], + "numPathTraces" : 3, + "bgpMeasurements" : true, + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "postBody" : "{ \\"example\\" : \\"value\\"}", + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.HttpServerTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "http-server", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "testName" : "ThousandEyes Test", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "overrideProxyId" : "281474976710706", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ], + "sslVersion" : "Auto", + "useNtlm" : false, + "ipv6Policy" : "use-agent-policy", + "downloadLimit" : 2048, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "usePublicBgp" : true, + "enabled" : true, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "headers" : [ "header1: value1", "header2: value2" ], + "numPathTraces" : 3, + "bgpMeasurements" : true, + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "postBody" : "{ \\"example\\" : \\"value\\"}", + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.HttpServerTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_http_server_test_models_validation(self) -> None: + """Test case for delete_http_server_test request and response models""" + + + def test_get_http_server_test_models_validation(self) -> None: + """Test case for get_http_server_test request and response models""" + + response_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "http-server", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "testName" : "ThousandEyes Test", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "overrideProxyId" : "281474976710706", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ], + "sslVersion" : "Auto", + "useNtlm" : false, + "ipv6Policy" : "use-agent-policy", + "downloadLimit" : 2048, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "usePublicBgp" : true, + "enabled" : true, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "headers" : [ "header1: value1", "header2: value2" ], + "numPathTraces" : 3, + "bgpMeasurements" : true, + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "postBody" : "{ \\"example\\" : \\"value\\"}", + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.HttpServerTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_http_server_tests_models_validation(self) -> None: + """Test case for get_http_server_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "http-server", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "testName" : "ThousandEyes Test", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "overrideProxyId" : "281474976710706", + "sslVersion" : "Auto", + "useNtlm" : false, + "ipv6Policy" : "use-agent-policy", + "downloadLimit" : 2048, + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "usePublicBgp" : true, + "enabled" : true, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "headers" : [ "header1: value1", "header2: value2" ], + "numPathTraces" : 3, + "bgpMeasurements" : true, + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "createdDate" : "2022-07-17T22:00:54Z", + "postBody" : "{ \\"example\\" : \\"value\\"}", + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + }, { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "http-server", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "testName" : "ThousandEyes Test", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "overrideProxyId" : "281474976710706", + "sslVersion" : "Auto", + "useNtlm" : false, + "ipv6Policy" : "use-agent-policy", + "downloadLimit" : 2048, + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "usePublicBgp" : true, + "enabled" : true, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "headers" : [ "header1: value1", "header2: value2" ], + "numPathTraces" : 3, + "bgpMeasurements" : true, + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "createdDate" : "2022-07-17T22:00:54Z", + "postBody" : "{ \\"example\\" : \\"value\\"}", + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.HttpServerTests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_http_server_test_models_validation(self) -> None: + """Test case for update_http_server_test request and response models""" + request_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "http-server", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "testName" : "ThousandEyes Test", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ "9842", "1283" ], + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "sharedWithAccounts" : [ "1234", "12345" ], + "overrideProxyId" : "281474976710706", + "monitors" : [ "17410", "5" ], + "sslVersion" : "Auto", + "useNtlm" : false, + "ipv6Policy" : "use-agent-policy", + "downloadLimit" : 2048, + "alertRules" : [ "344753", "212697" ], + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "usePublicBgp" : true, + "enabled" : true, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "headers" : [ "header1: value1", "header2: value2" ], + "numPathTraces" : 3, + "bgpMeasurements" : true, + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "postBody" : "{ \\"example\\" : \\"value\\"}", + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.HttpServerTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "http-server", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "testName" : "ThousandEyes Test", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "overrideProxyId" : "281474976710706", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ], + "sslVersion" : "Auto", + "useNtlm" : false, + "ipv6Policy" : "use-agent-policy", + "downloadLimit" : 2048, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "usePublicBgp" : true, + "enabled" : true, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "headers" : [ "header1: value1", "header2: value2" ], + "numPathTraces" : 3, + "bgpMeasurements" : true, + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "postBody" : "{ \\"example\\" : \\"value\\"}", + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.HttpServerTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-tests/test/test_page_load_tests_api.py b/thousandeyes-sdk-tests/test/test_page_load_tests_api.py new file mode 100644 index 000000000..b18dec748 --- /dev/null +++ b/thousandeyes-sdk-tests/test/test_page_load_tests_api.py @@ -0,0 +1,1094 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.tests.api.page_load_tests_api import PageLoadTestsApi + + +class TestPageLoadTestsApi(unittest.TestCase): + """PageLoadTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = PageLoadTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_page_load_test_models_validation(self) -> None: + """Test case for create_page_load_test request and response models""" + request_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "page-load", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ "9842", "1283" ], + "httpInterval" : 120, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "emulatedDeviceId" : "2", + "sharedWithAccounts" : [ "1234", "12345" ], + "overrideProxyId" : "281474976710706", + "monitors" : [ "17410", "5" ], + "sslVersion" : "Auto", + "useNtlm" : false, + "downloadLimit" : 2048, + "alertRules" : [ "344753", "212697" ], + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "usePublicBgp" : true, + "enabled" : true, + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "pageLoadTargetTime" : 10, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "savedEvent" : true, + "userAgent" : "curl", + "pageLoadTimeLimit" : 10, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "subinterval" : 60, + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.PageLoadTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "page-load", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "httpInterval" : 120, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "emulatedDeviceId" : "2", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "overrideProxyId" : "281474976710706", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ], + "sslVersion" : "Auto", + "useNtlm" : false, + "downloadLimit" : 2048, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "usePublicBgp" : true, + "enabled" : true, + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "pageLoadTargetTime" : 10, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "savedEvent" : true, + "userAgent" : "curl", + "pageLoadTimeLimit" : 10, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "subinterval" : 60, + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.PageLoadTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_page_load_test_models_validation(self) -> None: + """Test case for delete_page_load_test request and response models""" + + + def test_get_page_load_test_models_validation(self) -> None: + """Test case for get_page_load_test request and response models""" + + response_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "page-load", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "httpInterval" : 120, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "emulatedDeviceId" : "2", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "overrideProxyId" : "281474976710706", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ], + "sslVersion" : "Auto", + "useNtlm" : false, + "downloadLimit" : 2048, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "usePublicBgp" : true, + "enabled" : true, + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "pageLoadTargetTime" : 10, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "savedEvent" : true, + "userAgent" : "curl", + "pageLoadTimeLimit" : 10, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "subinterval" : 60, + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.PageLoadTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_page_load_tests_models_validation(self) -> None: + """Test case for get_page_load_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "page-load", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "httpInterval" : 120, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "emulatedDeviceId" : "2", + "overrideProxyId" : "281474976710706", + "sslVersion" : "Auto", + "useNtlm" : false, + "downloadLimit" : 2048, + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "usePublicBgp" : true, + "enabled" : true, + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "pageLoadTargetTime" : 10, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "savedEvent" : true, + "userAgent" : "curl", + "pageLoadTimeLimit" : 10, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "subinterval" : 60, + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + }, { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "page-load", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "httpInterval" : 120, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "emulatedDeviceId" : "2", + "overrideProxyId" : "281474976710706", + "sslVersion" : "Auto", + "useNtlm" : false, + "downloadLimit" : 2048, + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "usePublicBgp" : true, + "enabled" : true, + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "pageLoadTargetTime" : 10, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "savedEvent" : true, + "userAgent" : "curl", + "pageLoadTimeLimit" : 10, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "subinterval" : 60, + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.PageLoadTests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_page_load_test_models_validation(self) -> None: + """Test case for update_page_load_test request and response models""" + request_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "page-load", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ "9842", "1283" ], + "httpInterval" : 120, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "emulatedDeviceId" : "2", + "sharedWithAccounts" : [ "1234", "12345" ], + "overrideProxyId" : "281474976710706", + "monitors" : [ "17410", "5" ], + "sslVersion" : "Auto", + "useNtlm" : false, + "downloadLimit" : 2048, + "alertRules" : [ "344753", "212697" ], + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "usePublicBgp" : true, + "enabled" : true, + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "pageLoadTargetTime" : 10, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "savedEvent" : true, + "userAgent" : "curl", + "pageLoadTimeLimit" : 10, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "subinterval" : 60, + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.PageLoadTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "page-load", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "httpInterval" : 120, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "emulatedDeviceId" : "2", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "overrideProxyId" : "281474976710706", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ], + "sslVersion" : "Auto", + "useNtlm" : false, + "downloadLimit" : 2048, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "usePublicBgp" : true, + "enabled" : true, + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "pageLoadTargetTime" : 10, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "savedEvent" : true, + "userAgent" : "curl", + "pageLoadTimeLimit" : 10, + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "subinterval" : 60, + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.PageLoadTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-tests/test/test_sip_server_tests_api.py b/thousandeyes-sdk-tests/test/test_sip_server_tests_api.py new file mode 100644 index 000000000..d76606a60 --- /dev/null +++ b/thousandeyes-sdk-tests/test/test_sip_server_tests_api.py @@ -0,0 +1,762 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.tests.api.sip_server_tests_api import SIPServerTestsApi + + +class TestSIPServerTestsApi(unittest.TestCase): + """SIPServerTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = SIPServerTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_sip_server_test_models_validation(self) -> None: + """Test case for create_sip_server_test request and response models""" + request_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "registerEnabled" : false, + "alertRules" : [ "344753", "212697" ], + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "sip-server", + "usePublicBgp" : true, + "enabled" : true, + "fixedPacketRate" : 50, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "targetSipCredentials" : { + "password" : "password", + "protocol" : "tcp", + "port" : 49153, + "sipRegistrar" : "voice.thousandeyes.com", + "authUser" : "username", + "user" : "username" + }, + "testName" : "ThousandEyes Test", + "sipTargetTime" : 1000, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "optionsRegex" : "[\\"a-z\\"]", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "sipTimeLimit" : 5, + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.SipServerTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "registerEnabled" : false, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "sip-server", + "authUser" : "username", + "usePublicBgp" : true, + "enabled" : true, + "fixedPacketRate" : 50, + "password" : "password", + "protocol" : "tcp", + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "sipTargetTime" : 1000, + "bgpMeasurements" : true, + "numPathTraces" : 3, + "optionsRegex" : "[\\"a-z\\"]", + "liveShare" : false, + "savedEvent" : true, + "sipRegistrar" : "voice.thousandeyes.com", + "networkMeasurements" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "sipTimeLimit" : 5, + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "user" : "username", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.SipServerTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_sip_server_test_models_validation(self) -> None: + """Test case for delete_sip_server_test request and response models""" + + + def test_get_sip_server_test_models_validation(self) -> None: + """Test case for get_sip_server_test request and response models""" + + response_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "registerEnabled" : false, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "sip-server", + "authUser" : "username", + "usePublicBgp" : true, + "enabled" : true, + "fixedPacketRate" : 50, + "password" : "password", + "protocol" : "tcp", + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "sipTargetTime" : 1000, + "bgpMeasurements" : true, + "numPathTraces" : 3, + "optionsRegex" : "[\\"a-z\\"]", + "liveShare" : false, + "savedEvent" : true, + "sipRegistrar" : "voice.thousandeyes.com", + "networkMeasurements" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "sipTimeLimit" : 5, + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "user" : "username", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.SipServerTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_sip_server_tests_models_validation(self) -> None: + """Test case for get_sip_server_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "registerEnabled" : false, + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "sip-server", + "authUser" : "username", + "usePublicBgp" : true, + "enabled" : true, + "fixedPacketRate" : 50, + "password" : "password", + "protocol" : "tcp", + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "sipTargetTime" : 1000, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "optionsRegex" : "[\\"a-z\\"]", + "liveShare" : false, + "savedEvent" : true, + "sipRegistrar" : "voice.thousandeyes.com", + "networkMeasurements" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "sipTimeLimit" : 5, + "interval" : 60, + "testId" : "281474976710706", + "user" : "username" + }, { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "registerEnabled" : false, + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "sip-server", + "authUser" : "username", + "usePublicBgp" : true, + "enabled" : true, + "fixedPacketRate" : 50, + "password" : "password", + "protocol" : "tcp", + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "sipTargetTime" : 1000, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "optionsRegex" : "[\\"a-z\\"]", + "liveShare" : false, + "savedEvent" : true, + "sipRegistrar" : "voice.thousandeyes.com", + "networkMeasurements" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "sipTimeLimit" : 5, + "interval" : 60, + "testId" : "281474976710706", + "user" : "username" + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.SipServerTests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_sip_server_test_models_validation(self) -> None: + """Test case for update_sip_server_test request and response models""" + request_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "registerEnabled" : false, + "alertRules" : [ "344753", "212697" ], + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "sip-server", + "usePublicBgp" : true, + "enabled" : true, + "fixedPacketRate" : 50, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "targetSipCredentials" : { + "password" : "password", + "protocol" : "tcp", + "port" : 49153, + "sipRegistrar" : "voice.thousandeyes.com", + "authUser" : "username", + "user" : "username" + }, + "testName" : "ThousandEyes Test", + "sipTargetTime" : 1000, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "optionsRegex" : "[\\"a-z\\"]", + "liveShare" : false, + "savedEvent" : true, + "networkMeasurements" : true, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "sipTimeLimit" : 5, + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.SipServerTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "mtuMeasurements" : false, + "ipv6Policy" : "use-agent-policy", + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "registerEnabled" : false, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "probeMode" : "auto", + "type" : "sip-server", + "authUser" : "username", + "usePublicBgp" : true, + "enabled" : true, + "fixedPacketRate" : 50, + "password" : "password", + "protocol" : "tcp", + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "sipTargetTime" : 1000, + "bgpMeasurements" : true, + "numPathTraces" : 3, + "optionsRegex" : "[\\"a-z\\"]", + "liveShare" : false, + "savedEvent" : true, + "sipRegistrar" : "voice.thousandeyes.com", + "networkMeasurements" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 49153, + "modifiedDate" : "2022-07-17T22:00:54Z", + "sipTimeLimit" : 5, + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "user" : "username", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.SipServerTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-tests/test/test_tests_api.py b/thousandeyes-sdk-tests/test/test_tests_api.py new file mode 100644 index 000000000..f3288c664 --- /dev/null +++ b/thousandeyes-sdk-tests/test/test_tests_api.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.tests.api.tests_api import TestsApi + + +class TestTestsApi(unittest.TestCase): + """TestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = TestsApi() + + def tearDown(self) -> None: + pass + + def test_get_tests_models_validation(self) -> None: + """Test case for get_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.Tests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-tests/test/test_voice_tests_api.py b/thousandeyes-sdk-tests/test/test_voice_tests_api.py new file mode 100644 index 000000000..c35e1b3eb --- /dev/null +++ b/thousandeyes-sdk-tests/test/test_voice_tests_api.py @@ -0,0 +1,702 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.tests.api.voice_tests_api import VoiceTestsApi + + +class TestVoiceTestsApi(unittest.TestCase): + """VoiceTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = VoiceTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_voice_test_models_validation(self) -> None: + """Test case for create_voice_test request and response models""" + request_body_json = """ + { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ "344753", "212697" ], + "description" : "ThousandEyes Test", + "type" : "voice", + "usePublicBgp" : true, + "enabled" : true, + "jitterBuffer" : 40, + "dscpId" : "0", + "duration" : 5, + "dscp" : "Best Effort (DSCP 0)", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "codec" : "G.711 @ 64 Kbps", + "codecId" : "0", + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 1024, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "281474976710706", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.VoiceTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "type" : "voice", + "usePublicBgp" : true, + "enabled" : true, + "jitterBuffer" : 40, + "dscpId" : "0", + "duration" : 5, + "dscp" : "Best Effort (DSCP 0)", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "codec" : "G.711 @ 64 Kbps", + "codecId" : "0", + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 1024, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "281474976710706", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.VoiceTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_voice_test_models_validation(self) -> None: + """Test case for delete_voice_test request and response models""" + + + def test_get_voice_test_models_validation(self) -> None: + """Test case for get_voice_test request and response models""" + + response_body_json = """ + { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "type" : "voice", + "usePublicBgp" : true, + "enabled" : true, + "jitterBuffer" : 40, + "dscpId" : "0", + "duration" : 5, + "dscp" : "Best Effort (DSCP 0)", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "codec" : "G.711 @ 64 Kbps", + "codecId" : "0", + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 1024, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "281474976710706", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.VoiceTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_voice_tests_models_validation(self) -> None: + """Test case for get_voice_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "description" : "ThousandEyes Test", + "type" : "voice", + "usePublicBgp" : true, + "enabled" : true, + "jitterBuffer" : 40, + "dscpId" : "0", + "duration" : 5, + "dscp" : "Best Effort (DSCP 0)", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "codec" : "G.711 @ 64 Kbps", + "codecId" : "0", + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 1024, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "281474976710706", + "interval" : 60, + "testId" : "281474976710706" + }, { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "description" : "ThousandEyes Test", + "type" : "voice", + "usePublicBgp" : true, + "enabled" : true, + "jitterBuffer" : 40, + "dscpId" : "0", + "duration" : 5, + "dscp" : "Best Effort (DSCP 0)", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "codec" : "G.711 @ 64 Kbps", + "codecId" : "0", + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 1024, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "281474976710706", + "interval" : 60, + "testId" : "281474976710706" + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.VoiceTests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_voice_test_models_validation(self) -> None: + """Test case for update_voice_test request and response models""" + request_body_json = """ + { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ "344753", "212697" ], + "description" : "ThousandEyes Test", + "type" : "voice", + "usePublicBgp" : true, + "enabled" : true, + "jitterBuffer" : 40, + "dscpId" : "0", + "duration" : 5, + "dscp" : "Best Effort (DSCP 0)", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "labels" : [ "9842", "1283" ], + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "codec" : "G.711 @ 64 Kbps", + "codecId" : "0", + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 1024, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "281474976710706", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ "1234", "12345" ], + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.VoiceTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "type" : "voice", + "usePublicBgp" : true, + "enabled" : true, + "jitterBuffer" : 40, + "dscpId" : "0", + "duration" : 5, + "dscp" : "Best Effort (DSCP 0)", + "modifiedBy" : "user@user.com", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test", + "numPathTraces" : 3, + "bgpMeasurements" : true, + "liveShare" : false, + "savedEvent" : true, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "codec" : "G.711 @ 64 Kbps", + "codecId" : "0", + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "port" : 1024, + "modifiedDate" : "2022-07-17T22:00:54Z", + "targetAgentId" : "281474976710706", + "interval" : 60, + "testId" : "281474976710706", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.VoiceTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-tests/test/test_web_transaction_tests_api.py b/thousandeyes-sdk-tests/test/test_web_transaction_tests_api.py new file mode 100644 index 000000000..2e66c72b3 --- /dev/null +++ b/thousandeyes-sdk-tests/test/test_web_transaction_tests_api.py @@ -0,0 +1,1099 @@ +# coding: utf-8 + +""" + Tests API + + This API supports listing, creating, editing, and deleting Cloud and Enterprise Agent (CEA) based tests. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.tests.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.tests.api.web_transaction_tests_api import WebTransactionTestsApi + + +class TestWebTransactionTestsApi(unittest.TestCase): + """WebTransactionTestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = WebTransactionTestsApi() + + def tearDown(self) -> None: + pass + + def test_create_web_transactions_test_models_validation(self) -> None: + """Test case for create_web_transactions_test request and response models""" + request_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "web-transactions", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ "9842", "1283" ], + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "emulatedDeviceId" : "2", + "sharedWithAccounts" : [ "1234", "12345" ], + "overrideProxyId" : "281474976710706", + "monitors" : [ "17410", "5" ], + "sslVersion" : "Auto", + "useNtlm" : false, + "credentials" : [ "3247", "1051" ], + "downloadLimit" : 2048, + "alertRules" : [ "344753", "212697" ], + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "usePublicBgp" : true, + "enabled" : true, + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "transactionScript" : "if (true) { return true; }", + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "timeLimit" : 30, + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "subinterval" : 60, + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username", + "targetTime" : 1 + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.WebTransactionTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "web-transactions", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "emulatedDeviceId" : "2", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "overrideProxyId" : "281474976710706", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ], + "sslVersion" : "Auto", + "useNtlm" : false, + "credentials" : [ "3247", "1051" ], + "downloadLimit" : 2048, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "usePublicBgp" : true, + "enabled" : true, + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "transactionScript" : "if (true) { return true; }", + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "timeLimit" : 30, + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "subinterval" : 60, + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username", + "targetTime" : 1 + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.WebTransactionTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_web_transactions_test_models_validation(self) -> None: + """Test case for delete_web_transactions_test request and response models""" + + + def test_get_web_transactions_test_models_validation(self) -> None: + """Test case for get_web_transactions_test request and response models""" + + response_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "web-transactions", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "emulatedDeviceId" : "2", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "overrideProxyId" : "281474976710706", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ], + "sslVersion" : "Auto", + "useNtlm" : false, + "credentials" : [ "3247", "1051" ], + "downloadLimit" : 2048, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "usePublicBgp" : true, + "enabled" : true, + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "transactionScript" : "if (true) { return true; }", + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "timeLimit" : 30, + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "subinterval" : 60, + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username", + "targetTime" : 1 + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.WebTransactionTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_web_transactions_tests_models_validation(self) -> None: + """Test case for get_web_transactions_tests request and response models""" + + response_body_json = """ + { + "tests" : [ { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "web-transactions", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "emulatedDeviceId" : "2", + "overrideProxyId" : "281474976710706", + "sslVersion" : "Auto", + "useNtlm" : false, + "downloadLimit" : 2048, + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "usePublicBgp" : true, + "enabled" : true, + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "transactionScript" : "if (true) { return true; }", + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "timeLimit" : 30, + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "subinterval" : 60, + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username", + "targetTime" : 1 + }, { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "web-transactions", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "emulatedDeviceId" : "2", + "overrideProxyId" : "281474976710706", + "sslVersion" : "Auto", + "useNtlm" : false, + "downloadLimit" : 2048, + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "usePublicBgp" : true, + "enabled" : true, + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "transactionScript" : "if (true) { return true; }", + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "timeLimit" : 30, + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "subinterval" : 60, + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username", + "targetTime" : 1 + } ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.WebTransactionTests.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_web_transactions_test_models_validation(self) -> None: + """Test case for update_web_transactions_test request and response models""" + request_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "web-transactions", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ "9842", "1283" ], + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "emulatedDeviceId" : "2", + "sharedWithAccounts" : [ "1234", "12345" ], + "overrideProxyId" : "281474976710706", + "monitors" : [ "17410", "5" ], + "sslVersion" : "Auto", + "useNtlm" : false, + "credentials" : [ "3247", "1051" ], + "downloadLimit" : 2048, + "alertRules" : [ "344753", "212697" ], + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "usePublicBgp" : true, + "enabled" : true, + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "transactionScript" : "if (true) { return true; }", + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + }, { + "agentId" : "125", + "sourceIpAddress" : "1.1.1.1" + } ], + "timeLimit" : 30, + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "subinterval" : 60, + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username", + "targetTime" : 1 + }""" + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.tests.models.WebTransactionTestRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "clientCertificate" : "-----BEGIN PRIVATE KEY-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END PRIVATE KEY-----\\n-----BEGIN CERTIFICATE-----\\nMIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL\\n-----END CERTIFICATE-----\\n", + "mtuMeasurements" : false, + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "dnsOverride" : "8.8.8.8", + "bandwidthMeasurements" : true, + "probeMode" : "auto", + "includeHeaders" : true, + "type" : "web-transactions", + "oAuth" : { + "configId" : "123321123", + "testUrl" : "https://api.thousandeyes.com/v7/status", + "requestMethod" : "get", + "postBody" : "client_id: ************", + "headers" : "Authorization: Basic ************", + "authType" : "none", + "username" : "user123", + "password" : "*******" + }, + "password" : "password", + "protocol" : "tcp", + "followRedirects" : true, + "contentRegex" : "(regex)+", + "pageLoadingStrategy" : "normal", + "testName" : "ThousandEyes Test", + "allowMicAndCamera" : false, + "browserLanguage" : "en-US", + "verifyCertificate" : false, + "overrideAgentProxy" : false, + "liveShare" : false, + "agentInterfaces" : { + "agentId" : "2954", + "ipAddress" : "192.1.1.0" + }, + "labels" : [ { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + }, { + "labelId" : "961", + "name" : "Artem label", + "isBuiltin" : false + } ], + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "emulatedDeviceId" : "2", + "sharedWithAccounts" : [ { + "name" : "Account name", + "aid" : "1234" + }, { + "name" : "Account name", + "aid" : "1234" + } ], + "overrideProxyId" : "281474976710706", + "monitors" : [ { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + }, { + "monitorType" : "public", + "monitorId" : "1234", + "monitorName" : "Seattle, WA", + "ipAddress" : "4.69.184.193", + "countryId" : "GB", + "network" : "Level 3 Communications, Inc. (AS 3356)" + } ], + "sslVersion" : "Auto", + "useNtlm" : false, + "credentials" : [ "3247", "1051" ], + "downloadLimit" : 2048, + "alertRules" : [ { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + }, { + "severity" : "major", + "expression" : "((hops((hopDelay >= 100 ms))))", + "alertType" : "http-server", + "roundsViolatingMode" : "exact", + "sensitivityLevel" : "medium", + "roundsViolatingOutOf" : 5, + "roundsViolatingRequired" : 2, + "isDefault" : true, + "minimumSourcesPct" : 99, + "ruleName" : "The End of the Internet", + "minimumSources" : 10, + "ruleId" : "127094", + "direction" : "to-target" + } ], + "description" : "ThousandEyes Test", + "httpTimeLimit" : 5, + "blockDomains" : "domain.com/", + "usePublicBgp" : true, + "enabled" : true, + "allowGeolocation" : false, + "allowUnsafeLegacyRenegotiation" : true, + "fixedPacketRate" : 50, + "httpVersion" : 2, + "collectProxyNetworkData" : false, + "pathTraceMode" : "classic", + "modifiedBy" : "user@user.com", + "authType" : "none", + "alertsEnabled" : true, + "customHeaders" : { + "root" : { + "header1" : "value1" + }, + "domains" : { + "domain1.com" : { + "header2" : "value2" + } + }, + "all" : { + "header3" : "value3" + } + }, + "numPathTraces" : 3, + "bgpMeasurements" : true, + "transactionScript" : "if (true) { return true; }", + "savedEvent" : true, + "userAgent" : "curl", + "networkMeasurements" : true, + "url" : "www.thousandeyes.com", + "agents" : [ { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + }, { + "agentId" : "281474976710706", + "agentType" : "enterprise-cluster", + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "verifySslCertificates" : true + } ], + "timeLimit" : 30, + "createdDate" : "2022-07-17T22:00:54Z", + "disableScreenshot" : false, + "createdBy" : "user@user.com", + "testId" : "281474976710706", + "subinterval" : 60, + "desiredStatusCode" : "200", + "httpTargetTime" : 100, + "sslVersionId" : "0", + "username" : "username", + "targetTime" : 1 + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.tests.models.WebTransactionTestResponse.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-usage/.openapi-generator/FILES b/thousandeyes-sdk-usage/.openapi-generator/FILES index bc1dea14d..6d43a6045 100644 --- a/thousandeyes-sdk-usage/.openapi-generator/FILES +++ b/thousandeyes-sdk-usage/.openapi-generator/FILES @@ -2,15 +2,15 @@ MANIFEST.in README.md docs/AccountGroupQuota.md -docs/EndpointAgents.md docs/EndpointAgentsEmbedded.md docs/EndpointAgentsEssentials.md +docs/EndpointAgentsUsage.md docs/EnterpriseAgentUnits.md docs/EnterpriseAgentUnitsByTestOwnerAccountGroup.md docs/EnterpriseAgents.md docs/EnterpriseAgentsUsage.md docs/Error.md -docs/Expand.md +docs/ExpandUsageOptions.md docs/Link.md docs/OrganizationQuota.md docs/OrganizationQuotaAssignment.md @@ -25,7 +25,7 @@ docs/QuotasAssignRequest.md docs/QuotasAssignResponse.md docs/QuotasUnassign.md docs/SelfLinks.md -docs/Tests.md +docs/TestUsage.md docs/TestsUsage.md docs/UnauthorizedError.md docs/UnitsByTests.md @@ -43,15 +43,15 @@ src/thousandeyes_sdk/usage/api/quotas_api.py src/thousandeyes_sdk/usage/api/usage_api.py src/thousandeyes_sdk/usage/models/__init__.py src/thousandeyes_sdk/usage/models/account_group_quota.py -src/thousandeyes_sdk/usage/models/endpoint_agents.py src/thousandeyes_sdk/usage/models/endpoint_agents_embedded.py src/thousandeyes_sdk/usage/models/endpoint_agents_essentials.py +src/thousandeyes_sdk/usage/models/endpoint_agents_usage.py src/thousandeyes_sdk/usage/models/enterprise_agent_units.py src/thousandeyes_sdk/usage/models/enterprise_agent_units_by_test_owner_account_group.py src/thousandeyes_sdk/usage/models/enterprise_agents.py src/thousandeyes_sdk/usage/models/enterprise_agents_usage.py src/thousandeyes_sdk/usage/models/error.py -src/thousandeyes_sdk/usage/models/expand.py +src/thousandeyes_sdk/usage/models/expand_usage_options.py src/thousandeyes_sdk/usage/models/link.py src/thousandeyes_sdk/usage/models/organization_quota.py src/thousandeyes_sdk/usage/models/organization_quota_assignment.py @@ -65,7 +65,7 @@ src/thousandeyes_sdk/usage/models/quotas_assign_request.py src/thousandeyes_sdk/usage/models/quotas_assign_response.py src/thousandeyes_sdk/usage/models/quotas_unassign.py src/thousandeyes_sdk/usage/models/self_links.py -src/thousandeyes_sdk/usage/models/tests.py +src/thousandeyes_sdk/usage/models/test_usage.py src/thousandeyes_sdk/usage/models/tests_usage.py src/thousandeyes_sdk/usage/models/unauthorized_error.py src/thousandeyes_sdk/usage/models/units_by_tests.py diff --git a/thousandeyes-sdk-usage/README.md b/thousandeyes-sdk-usage/README.md index 5c9157199..8667d8fd8 100644 --- a/thousandeyes-sdk-usage/README.md +++ b/thousandeyes-sdk-usage/README.md @@ -17,7 +17,7 @@ Refer to the Usage API endpoints for detailed usage instructions and optional pa This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.15 +- API version: 7.0.19 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -121,15 +121,15 @@ Class | Method | HTTP request | Description ## Documentation For Models - [AccountGroupQuota](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/AccountGroupQuota.md) - - [EndpointAgents](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/EndpointAgents.md) - [EndpointAgentsEmbedded](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/EndpointAgentsEmbedded.md) - [EndpointAgentsEssentials](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/EndpointAgentsEssentials.md) + - [EndpointAgentsUsage](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/EndpointAgentsUsage.md) - [EnterpriseAgentUnits](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/EnterpriseAgentUnits.md) - [EnterpriseAgentUnitsByTestOwnerAccountGroup](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/EnterpriseAgentUnitsByTestOwnerAccountGroup.md) - [EnterpriseAgents](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/EnterpriseAgents.md) - [EnterpriseAgentsUsage](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/EnterpriseAgentsUsage.md) - [Error](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/Error.md) - - [Expand](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/Expand.md) + - [ExpandUsageOptions](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/ExpandUsageOptions.md) - [Link](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/Link.md) - [OrganizationQuota](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/OrganizationQuota.md) - [OrganizationQuotaAssignment](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/OrganizationQuotaAssignment.md) @@ -143,7 +143,7 @@ Class | Method | HTTP request | Description - [QuotasAssignResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/QuotasAssignResponse.md) - [QuotasUnassign](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/QuotasUnassign.md) - [SelfLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/SelfLinks.md) - - [Tests](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/Tests.md) + - [TestUsage](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/TestUsage.md) - [TestsUsage](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/TestsUsage.md) - [UnauthorizedError](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/UnauthorizedError.md) - [UnitsByTests](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-usage/docs/UnitsByTests.md) diff --git a/thousandeyes-sdk-usage/docs/EndpointAgentsUsage.md b/thousandeyes-sdk-usage/docs/EndpointAgentsUsage.md new file mode 100644 index 000000000..cfdf8773f --- /dev/null +++ b/thousandeyes-sdk-usage/docs/EndpointAgentsUsage.md @@ -0,0 +1,31 @@ +# EndpointAgentsUsage + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | Unique identifier of the account group owning the endpoint agents. | [optional] +**account_group_name** | **str** | Name of the account group which owns the endpoint agents. | [optional] +**endpoint_agents_used** | **int** | Number of endpoint agents owned by the specific account group in the usage period. | [optional] + +## Example + +```python +from thousandeyes_sdk.usage.models.endpoint_agents_usage import EndpointAgentsUsage + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointAgentsUsage from a JSON string +endpoint_agents_usage_instance = EndpointAgentsUsage.from_json(json) +# print the JSON string representation of the object +print(EndpointAgentsUsage.to_json()) + +# convert the object into a dict +endpoint_agents_usage_dict = endpoint_agents_usage_instance.to_dict() +# create an instance of EndpointAgentsUsage from a dict +endpoint_agents_usage_from_dict = EndpointAgentsUsage.from_dict(endpoint_agents_usage_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-usage/docs/ExpandUsageOptions.md b/thousandeyes-sdk-usage/docs/ExpandUsageOptions.md new file mode 100644 index 000000000..2efd9d54c --- /dev/null +++ b/thousandeyes-sdk-usage/docs/ExpandUsageOptions.md @@ -0,0 +1,11 @@ +# ExpandUsageOptions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-usage/docs/TestUsage.md b/thousandeyes-sdk-usage/docs/TestUsage.md new file mode 100644 index 000000000..3e6129ce7 --- /dev/null +++ b/thousandeyes-sdk-usage/docs/TestUsage.md @@ -0,0 +1,35 @@ +# TestUsage + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | Unique identifier of the account group which owns the test. | [optional] +**account_group_name** | **str** | Name of the account group which owns the test. | [optional] +**test_id** | **str** | Unique identifier of the test generating usage. | [optional] +**test_name** | **str** | Name of the test generating usage. | [optional] +**test_type** | **str** | The type of test that generated the usage data. Note that this parameter provides a user-friendly description of the test type and should not be parsed to determine the endpoint for querying configuration details. | [optional] +**cloud_units_used** | **int** | Number of cloud units that the test has consumed in the usage period. | [optional] +**cloud_units_projected** | **int** | The estimated number of cloud units that the test is expected to consume during the usage period. This estimate is determined by considering the units consumed up to the current time and the test's configuration. It's important to note that this value is updated every hour. For new tests, the `cloudUnitsProjected` parameter is absent until the projection is calculated. | [optional] + +## Example + +```python +from thousandeyes_sdk.usage.models.test_usage import TestUsage + +# TODO update the JSON string below +json = "{}" +# create an instance of TestUsage from a JSON string +test_usage_instance = TestUsage.from_json(json) +# print the JSON string representation of the object +print(TestUsage.to_json()) + +# convert the object into a dict +test_usage_dict = test_usage_instance.to_dict() +# create an instance of TestUsage from a dict +test_usage_from_dict = TestUsage.from_dict(test_usage_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-usage/docs/UsageApi.md b/thousandeyes-sdk-usage/docs/UsageApi.md index 7d2ecb968..062e82df6 100644 --- a/thousandeyes-sdk-usage/docs/UsageApi.md +++ b/thousandeyes-sdk-usage/docs/UsageApi.md @@ -200,7 +200,7 @@ This endpoint returns usage for the current period. It provides visibility acros ```python import thousandeyes_sdk.usage -from thousandeyes_sdk.usage.models.expand import Expand +from thousandeyes_sdk.usage.models.expand_usage_options import ExpandUsageOptions from thousandeyes_sdk.usage.models.usage import Usage from thousandeyes_sdk.usage.rest import ApiException from pprint import pprint @@ -226,7 +226,7 @@ with thousandeyes_sdk.usage.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = thousandeyes_sdk.usage.UsageApi(api_client) aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) - expand = [thousandeyes_sdk.usage.Expand()] # List[Expand] | Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'. (optional) + expand = [thousandeyes_sdk.usage.ExpandUsageOptions()] # List[ExpandUsageOptions] | Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'. (optional) try: # Get usage information for the last month @@ -245,7 +245,7 @@ with thousandeyes_sdk.usage.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] - **expand** | [**List[Expand]**](Expand.md)| Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'. | [optional] + **expand** | [**List[ExpandUsageOptions]**](ExpandUsageOptions.md)| Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'. | [optional] ### Return type diff --git a/thousandeyes-sdk-usage/docs/UsageDetails.md b/thousandeyes-sdk-usage/docs/UsageDetails.md index 23f2348fb..232265ced 100644 --- a/thousandeyes-sdk-usage/docs/UsageDetails.md +++ b/thousandeyes-sdk-usage/docs/UsageDetails.md @@ -20,8 +20,8 @@ Name | Type | Description | Notes **endpoint_agents_embedded_used** | **int** | Number of embedded endpoint agents used in the current usage period. This number is calculated by taking the maximum number of agents enabled for any one-hour period in the usage period. Disabled agents are excluded from this calculation. | [optional] **enterprise_agents_used** | **int** | Number of enterprise agents used in the current usage period. This number is calculated by taking the maximum number of agents enabled for any one-hour period in the usage period. Disabled agents are excluded from this calculation. | [optional] **enterprise_agent_units** | [**List[EnterpriseAgentUnits]**](EnterpriseAgentUnits.md) | A breakdown of enterprise unit consumption for each agent during the current monthly period. Each entry provides data for both the current actual usage and the projected usage. Returns non-zero values for organizations with metered billing. | [optional] -**tests** | [**List[Tests]**](Tests.md) | A breakdown of unit consumption for each test during the current monthly period. Each entry provides information about both the current actual usage and the projected usage. | [optional] -**endpoint_agents** | [**List[EndpointAgents]**](EndpointAgents.md) | Endpoint agents used by account group. | [optional] +**tests** | [**List[TestUsage]**](TestUsage.md) | A breakdown of unit consumption for each test during the current monthly period. Each entry provides information about both the current actual usage and the projected usage. | [optional] +**endpoint_agents** | [**List[EndpointAgentsUsage]**](EndpointAgentsUsage.md) | Endpoint agents used by account group. | [optional] **endpoint_agents_essentials** | [**List[EndpointAgentsEssentials]**](EndpointAgentsEssentials.md) | Endpoint agents essentials used by account group. | [optional] **endpoint_agents_embedded** | [**List[EndpointAgentsEmbedded]**](EndpointAgentsEmbedded.md) | Endpoint agents embedded used by account group. | [optional] **enterprise_agents** | [**List[EnterpriseAgents]**](EnterpriseAgents.md) | Enterprise agents used by account group. | [optional] diff --git a/thousandeyes-sdk-usage/docs/UsageQuota.md b/thousandeyes-sdk-usage/docs/UsageQuota.md index 3680a83f5..083d7bf10 100644 --- a/thousandeyes-sdk-usage/docs/UsageQuota.md +++ b/thousandeyes-sdk-usage/docs/UsageQuota.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **month_start** | **datetime** | Beginning of usage period in UTC (ISO date-time format). | [optional] **month_end** | **datetime** | End of usage period in UTC (ISO date-time format).. | [optional] **cloud_units_included** | **int** | Monthly number of cloud units allocated, as part of the contract. | [optional] +**device_agents_included** | **int** | Number of device agents (connected devices product) allocated monthly, as specified in the contract. | [optional] **endpoint_agents_included** | **int** | Monthly number of endpoint agents allocated, as part of the contract. | [optional] **endpoint_agents_essentials_included** | **int** | Monthly number of endpoint agents essentials allocated, as part of the contract. | [optional] **endpoint_agents_embedded_included** | **int** | Number of embedded endpoint agents allocated monthly, as specified in the contract. | [optional] diff --git a/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/__init__.py b/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/__init__.py index 600507045..2ae51537d 100644 --- a/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/__init__.py +++ b/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/__init__.py @@ -20,15 +20,15 @@ # import models into sdk package from thousandeyes_sdk.usage.models.account_group_quota import AccountGroupQuota -from thousandeyes_sdk.usage.models.endpoint_agents import EndpointAgents from thousandeyes_sdk.usage.models.endpoint_agents_embedded import EndpointAgentsEmbedded from thousandeyes_sdk.usage.models.endpoint_agents_essentials import EndpointAgentsEssentials +from thousandeyes_sdk.usage.models.endpoint_agents_usage import EndpointAgentsUsage from thousandeyes_sdk.usage.models.enterprise_agent_units import EnterpriseAgentUnits from thousandeyes_sdk.usage.models.enterprise_agent_units_by_test_owner_account_group import EnterpriseAgentUnitsByTestOwnerAccountGroup from thousandeyes_sdk.usage.models.enterprise_agents import EnterpriseAgents from thousandeyes_sdk.usage.models.enterprise_agents_usage import EnterpriseAgentsUsage from thousandeyes_sdk.usage.models.error import Error -from thousandeyes_sdk.usage.models.expand import Expand +from thousandeyes_sdk.usage.models.expand_usage_options import ExpandUsageOptions from thousandeyes_sdk.usage.models.link import Link from thousandeyes_sdk.usage.models.organization_quota import OrganizationQuota from thousandeyes_sdk.usage.models.organization_quota_assignment import OrganizationQuotaAssignment @@ -42,7 +42,7 @@ from thousandeyes_sdk.usage.models.quotas_assign_response import QuotasAssignResponse from thousandeyes_sdk.usage.models.quotas_unassign import QuotasUnassign from thousandeyes_sdk.usage.models.self_links import SelfLinks -from thousandeyes_sdk.usage.models.tests import Tests +from thousandeyes_sdk.usage.models.test_usage import TestUsage from thousandeyes_sdk.usage.models.tests_usage import TestsUsage from thousandeyes_sdk.usage.models.unauthorized_error import UnauthorizedError from thousandeyes_sdk.usage.models.units_by_tests import UnitsByTests diff --git a/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/api/usage_api.py b/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/api/usage_api.py index 8879ea335..255c4b09c 100644 --- a/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/api/usage_api.py +++ b/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/api/usage_api.py @@ -23,7 +23,7 @@ from typing import List, Optional from typing_extensions import Annotated from thousandeyes_sdk.usage.models.enterprise_agents_usage import EnterpriseAgentsUsage -from thousandeyes_sdk.usage.models.expand import Expand +from thousandeyes_sdk.usage.models.expand_usage_options import ExpandUsageOptions from thousandeyes_sdk.usage.models.tests_usage import TestsUsage from thousandeyes_sdk.usage.models.usage import Usage @@ -735,7 +735,7 @@ def _get_tests_units_usage_serialize( def get_usage( self, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'.")] = None, + expand: Annotated[Optional[List[ExpandUsageOptions]], Field(description="Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -756,7 +756,7 @@ def get_usage( :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'. - :type expand: List[Expand] + :type expand: List[ExpandUsageOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -813,7 +813,7 @@ def get_usage( def get_usage_with_http_info( self, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'.")] = None, + expand: Annotated[Optional[List[ExpandUsageOptions]], Field(description="Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -834,7 +834,7 @@ def get_usage_with_http_info( :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'. - :type expand: List[Expand] + :type expand: List[ExpandUsageOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -891,7 +891,7 @@ def get_usage_with_http_info( def get_usage_without_preload_content( self, aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, - expand: Annotated[Optional[List[Expand]], Field(description="Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'.")] = None, + expand: Annotated[Optional[List[ExpandUsageOptions]], Field(description="Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -912,7 +912,7 @@ def get_usage_without_preload_content( :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. :type aid: str :param expand: Expands the available resources. By default, no expansion takes place if the `expand` query parameter is not passed. For example, to expand the \"tests\" resource, pass the query '?expand=test'. - :type expand: List[Expand] + :type expand: List[ExpandUsageOptions] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of diff --git a/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/__init__.py b/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/__init__.py index d9a8ac7fd..f26b5bec3 100644 --- a/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/__init__.py +++ b/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/__init__.py @@ -14,15 +14,15 @@ # import models into model package from thousandeyes_sdk.usage.models.account_group_quota import AccountGroupQuota -from thousandeyes_sdk.usage.models.endpoint_agents import EndpointAgents from thousandeyes_sdk.usage.models.endpoint_agents_embedded import EndpointAgentsEmbedded from thousandeyes_sdk.usage.models.endpoint_agents_essentials import EndpointAgentsEssentials +from thousandeyes_sdk.usage.models.endpoint_agents_usage import EndpointAgentsUsage from thousandeyes_sdk.usage.models.enterprise_agent_units import EnterpriseAgentUnits from thousandeyes_sdk.usage.models.enterprise_agent_units_by_test_owner_account_group import EnterpriseAgentUnitsByTestOwnerAccountGroup from thousandeyes_sdk.usage.models.enterprise_agents import EnterpriseAgents from thousandeyes_sdk.usage.models.enterprise_agents_usage import EnterpriseAgentsUsage from thousandeyes_sdk.usage.models.error import Error -from thousandeyes_sdk.usage.models.expand import Expand +from thousandeyes_sdk.usage.models.expand_usage_options import ExpandUsageOptions from thousandeyes_sdk.usage.models.link import Link from thousandeyes_sdk.usage.models.organization_quota import OrganizationQuota from thousandeyes_sdk.usage.models.organization_quota_assignment import OrganizationQuotaAssignment @@ -36,7 +36,7 @@ from thousandeyes_sdk.usage.models.quotas_assign_response import QuotasAssignResponse from thousandeyes_sdk.usage.models.quotas_unassign import QuotasUnassign from thousandeyes_sdk.usage.models.self_links import SelfLinks -from thousandeyes_sdk.usage.models.tests import Tests +from thousandeyes_sdk.usage.models.test_usage import TestUsage from thousandeyes_sdk.usage.models.tests_usage import TestsUsage from thousandeyes_sdk.usage.models.unauthorized_error import UnauthorizedError from thousandeyes_sdk.usage.models.units_by_tests import UnitsByTests diff --git a/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/endpoint_agents_usage.py b/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/endpoint_agents_usage.py new file mode 100644 index 000000000..806af8ff3 --- /dev/null +++ b/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/endpoint_agents_usage.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Usage API + + These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View organization usage` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View organization usage` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the Usage API endpoints for detailed usage instructions and optional parameters. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class EndpointAgentsUsage(BaseModel): + """ + EndpointAgentsUsage + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="Unique identifier of the account group owning the endpoint agents.") + account_group_name: Optional[StrictStr] = Field(default=None, description="Name of the account group which owns the endpoint agents.", alias="accountGroupName") + endpoint_agents_used: Optional[StrictInt] = Field(default=None, description="Number of endpoint agents owned by the specific account group in the usage period.", alias="endpointAgentsUsed") + __properties: ClassVar[List[str]] = ["aid", "accountGroupName", "endpointAgentsUsed"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EndpointAgentsUsage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EndpointAgentsUsage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "accountGroupName": obj.get("accountGroupName"), + "endpointAgentsUsed": obj.get("endpointAgentsUsed") + }) + return _obj + + diff --git a/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/expand_usage_options.py b/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/expand_usage_options.py new file mode 100644 index 000000000..806aa0bea --- /dev/null +++ b/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/expand_usage_options.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Usage API + + These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View organization usage` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View organization usage` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the Usage API endpoints for detailed usage instructions and optional parameters. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ExpandUsageOptions(str, Enum): + """ + ExpandUsageOptions + """ + + """ + allowed enum values + """ + TEST = 'test' + ENTERPRISE_MINUS_AGENT = 'enterprise-agent' + ENTERPRISE_MINUS_AGENT_MINUS_UNIT = 'enterprise-agent-unit' + ENDPOINT_MINUS_AGENT = 'endpoint-agent' + ENDPOINT_MINUS_AGENT_MINUS_ESSENTIAL = 'endpoint-agent-essential' + ENDPOINT_MINUS_AGENT_MINUS_EMBEDDED = 'endpoint-agent-embedded' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ExpandUsageOptions from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/test_usage.py b/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/test_usage.py new file mode 100644 index 000000000..cf7f67d70 --- /dev/null +++ b/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/test_usage.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Usage API + + These usage endpoints define the following operations: * **Usage**: Retrieve usage data for the specified time period (default is one month). * Users must have the `View organization usage` permission to access this endpoint. * This endpoint offers visibility across all account groups within the organization. * Users with `View organization usage` permission in multiple organizations should query the endpoint with the `aid` query string parameter (see optional parameters) for each organization. * **Quotas**: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas. * Users must have the necessary permissions to perform quota-related actions. Refer to the Usage API endpoints for detailed usage instructions and optional parameters. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TestUsage(BaseModel): + """ + TestUsage + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="Unique identifier of the account group which owns the test.") + account_group_name: Optional[StrictStr] = Field(default=None, description="Name of the account group which owns the test.", alias="accountGroupName") + test_id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the test generating usage.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="Name of the test generating usage.", alias="testName") + test_type: Optional[StrictStr] = Field(default=None, description="The type of test that generated the usage data. Note that this parameter provides a user-friendly description of the test type and should not be parsed to determine the endpoint for querying configuration details.", alias="testType") + cloud_units_used: Optional[StrictInt] = Field(default=None, description="Number of cloud units that the test has consumed in the usage period.", alias="cloudUnitsUsed") + cloud_units_projected: Optional[StrictInt] = Field(default=None, description="The estimated number of cloud units that the test is expected to consume during the usage period. This estimate is determined by considering the units consumed up to the current time and the test's configuration. It's important to note that this value is updated every hour. For new tests, the `cloudUnitsProjected` parameter is absent until the projection is calculated.", alias="cloudUnitsProjected") + __properties: ClassVar[List[str]] = ["aid", "accountGroupName", "testId", "testName", "testType", "cloudUnitsUsed", "cloudUnitsProjected"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TestUsage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TestUsage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "accountGroupName": obj.get("accountGroupName"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "testType": obj.get("testType"), + "cloudUnitsUsed": obj.get("cloudUnitsUsed"), + "cloudUnitsProjected": obj.get("cloudUnitsProjected") + }) + return _obj + + diff --git a/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/usage_details.py b/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/usage_details.py index 2c6989f8b..92577e06e 100644 --- a/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/usage_details.py +++ b/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/usage_details.py @@ -18,12 +18,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from thousandeyes_sdk.usage.models.endpoint_agents import EndpointAgents from thousandeyes_sdk.usage.models.endpoint_agents_embedded import EndpointAgentsEmbedded from thousandeyes_sdk.usage.models.endpoint_agents_essentials import EndpointAgentsEssentials +from thousandeyes_sdk.usage.models.endpoint_agents_usage import EndpointAgentsUsage from thousandeyes_sdk.usage.models.enterprise_agent_units import EnterpriseAgentUnits from thousandeyes_sdk.usage.models.enterprise_agents import EnterpriseAgents -from thousandeyes_sdk.usage.models.tests import Tests +from thousandeyes_sdk.usage.models.test_usage import TestUsage from thousandeyes_sdk.usage.models.usage_quota import UsageQuota from typing import Optional, Set from typing_extensions import Self @@ -47,8 +47,8 @@ class UsageDetails(BaseModel): endpoint_agents_embedded_used: Optional[StrictInt] = Field(default=None, description="Number of embedded endpoint agents used in the current usage period. This number is calculated by taking the maximum number of agents enabled for any one-hour period in the usage period. Disabled agents are excluded from this calculation.", alias="endpointAgentsEmbeddedUsed") enterprise_agents_used: Optional[StrictInt] = Field(default=None, description="Number of enterprise agents used in the current usage period. This number is calculated by taking the maximum number of agents enabled for any one-hour period in the usage period. Disabled agents are excluded from this calculation.", alias="enterpriseAgentsUsed") enterprise_agent_units: Optional[List[EnterpriseAgentUnits]] = Field(default=None, description="A breakdown of enterprise unit consumption for each agent during the current monthly period. Each entry provides data for both the current actual usage and the projected usage. Returns non-zero values for organizations with metered billing.", alias="enterpriseAgentUnits") - tests: Optional[List[Tests]] = Field(default=None, description="A breakdown of unit consumption for each test during the current monthly period. Each entry provides information about both the current actual usage and the projected usage.") - endpoint_agents: Optional[List[EndpointAgents]] = Field(default=None, description="Endpoint agents used by account group.", alias="endpointAgents") + tests: Optional[List[TestUsage]] = Field(default=None, description="A breakdown of unit consumption for each test during the current monthly period. Each entry provides information about both the current actual usage and the projected usage.") + endpoint_agents: Optional[List[EndpointAgentsUsage]] = Field(default=None, description="Endpoint agents used by account group.", alias="endpointAgents") endpoint_agents_essentials: Optional[List[EndpointAgentsEssentials]] = Field(default=None, description="Endpoint agents essentials used by account group.", alias="endpointAgentsEssentials") endpoint_agents_embedded: Optional[List[EndpointAgentsEmbedded]] = Field(default=None, description="Endpoint agents embedded used by account group.", alias="endpointAgentsEmbedded") enterprise_agents: Optional[List[EnterpriseAgents]] = Field(default=None, description="Enterprise agents used by account group.", alias="enterpriseAgents") @@ -166,8 +166,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "endpointAgentsEmbeddedUsed": obj.get("endpointAgentsEmbeddedUsed"), "enterpriseAgentsUsed": obj.get("enterpriseAgentsUsed"), "enterpriseAgentUnits": [EnterpriseAgentUnits.from_dict(_item) for _item in obj["enterpriseAgentUnits"]] if obj.get("enterpriseAgentUnits") is not None else None, - "tests": [Tests.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None, - "endpointAgents": [EndpointAgents.from_dict(_item) for _item in obj["endpointAgents"]] if obj.get("endpointAgents") is not None else None, + "tests": [TestUsage.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None, + "endpointAgents": [EndpointAgentsUsage.from_dict(_item) for _item in obj["endpointAgents"]] if obj.get("endpointAgents") is not None else None, "endpointAgentsEssentials": [EndpointAgentsEssentials.from_dict(_item) for _item in obj["endpointAgentsEssentials"]] if obj.get("endpointAgentsEssentials") is not None else None, "endpointAgentsEmbedded": [EndpointAgentsEmbedded.from_dict(_item) for _item in obj["endpointAgentsEmbedded"]] if obj.get("endpointAgentsEmbedded") is not None else None, "enterpriseAgents": [EnterpriseAgents.from_dict(_item) for _item in obj["enterpriseAgents"]] if obj.get("enterpriseAgents") is not None else None diff --git a/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/usage_quota.py b/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/usage_quota.py index fb5705db1..70596d487 100644 --- a/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/usage_quota.py +++ b/thousandeyes-sdk-usage/src/thousandeyes_sdk/usage/models/usage_quota.py @@ -29,11 +29,12 @@ class UsageQuota(BaseModel): month_start: Optional[datetime] = Field(default=None, description="Beginning of usage period in UTC (ISO date-time format).", alias="monthStart") month_end: Optional[datetime] = Field(default=None, description="End of usage period in UTC (ISO date-time format)..", alias="monthEnd") cloud_units_included: Optional[StrictInt] = Field(default=None, description="Monthly number of cloud units allocated, as part of the contract.", alias="cloudUnitsIncluded") + device_agents_included: Optional[StrictInt] = Field(default=None, description="Number of device agents (connected devices product) allocated monthly, as specified in the contract.", alias="deviceAgentsIncluded") endpoint_agents_included: Optional[StrictInt] = Field(default=None, description="Monthly number of endpoint agents allocated, as part of the contract.", alias="endpointAgentsIncluded") endpoint_agents_essentials_included: Optional[StrictInt] = Field(default=None, description="Monthly number of endpoint agents essentials allocated, as part of the contract.", alias="endpointAgentsEssentialsIncluded") endpoint_agents_embedded_included: Optional[StrictInt] = Field(default=None, description="Number of embedded endpoint agents allocated monthly, as specified in the contract.", alias="endpointAgentsEmbeddedIncluded") enterprise_agents_included: Optional[StrictInt] = Field(default=None, description="Monthly number of enterprise agents allocated, as part of the contract. Returns non-zero value only for organizations with legacy billing.", alias="enterpriseAgentsIncluded") - __properties: ClassVar[List[str]] = ["monthStart", "monthEnd", "cloudUnitsIncluded", "endpointAgentsIncluded", "endpointAgentsEssentialsIncluded", "endpointAgentsEmbeddedIncluded", "enterpriseAgentsIncluded"] + __properties: ClassVar[List[str]] = ["monthStart", "monthEnd", "cloudUnitsIncluded", "deviceAgentsIncluded", "endpointAgentsIncluded", "endpointAgentsEssentialsIncluded", "endpointAgentsEmbeddedIncluded", "enterpriseAgentsIncluded"] model_config = ConfigDict( populate_by_name=True, @@ -90,6 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "monthStart": obj.get("monthStart"), "monthEnd": obj.get("monthEnd"), "cloudUnitsIncluded": obj.get("cloudUnitsIncluded"), + "deviceAgentsIncluded": obj.get("deviceAgentsIncluded"), "endpointAgentsIncluded": obj.get("endpointAgentsIncluded"), "endpointAgentsEssentialsIncluded": obj.get("endpointAgentsEssentialsIncluded"), "endpointAgentsEmbeddedIncluded": obj.get("endpointAgentsEmbeddedIncluded"), diff --git a/thousandeyes-sdk-usage/test/test_usage_api.py b/thousandeyes-sdk-usage/test/test_usage_api.py index fdc60f983..4b26e41c3 100644 --- a/thousandeyes-sdk-usage/test/test_usage_api.py +++ b/thousandeyes-sdk-usage/test/test_usage_api.py @@ -222,6 +222,7 @@ def test_get_usage_models_validation(self) -> None: "enterpriseAgentsIncluded" : 25, "monthStart" : "2020-01-05T08:00:00Z", "cloudUnitsIncluded" : 4320000000, + "deviceAgentsIncluded" : 100, "endpointAgentsIncluded" : 200, "endpointAgentsEssentialsIncluded" : 10 },